Usagestats: Add interface for stats for user.Service and add Usagestats for case_insensitive_login (#66742)
* add interface for stats * add user service to registry
This commit is contained in:
@@ -67,6 +67,17 @@ func ProvideService(
|
||||
return s, nil
|
||||
}
|
||||
|
||||
func (s *Service) GetUsageStats(ctx context.Context) map[string]interface{} {
|
||||
stats := map[string]interface{}{}
|
||||
caseInsensitiveLoginVal := 0
|
||||
if s.cfg.CaseInsensitiveLogin {
|
||||
caseInsensitiveLoginVal = 1
|
||||
}
|
||||
|
||||
stats["stats.case_insensitive_login.count"] = caseInsensitiveLoginVal
|
||||
return stats
|
||||
}
|
||||
|
||||
func (s *Service) Usage(ctx context.Context, _ *quota.ScopeParameters) (*quota.Map, error) {
|
||||
u := "a.Map{}
|
||||
if used, err := s.store.Count(ctx); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user