Skip to content

Commit d681d56

Browse files
authored
Optimize ingester userStats func (#6722)
Signed-off-by: SungJin1212 <[email protected]>
1 parent 4bec60c commit d681d56

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/ingester/ingester.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,11 +2032,9 @@ func (i *Ingester) userStats() []UserIDStats {
20322032
i.stoppedMtx.RLock()
20332033
defer i.stoppedMtx.RUnlock()
20342034

2035-
perUserTotals := make(map[string]UserStats)
2036-
20372035
users := i.TSDBState.dbs
20382036

2039-
response := make([]UserIDStats, 0, len(perUserTotals))
2037+
response := make([]UserIDStats, 0, len(users))
20402038
for id, db := range users {
20412039
response = append(response, UserIDStats{
20422040
UserID: id,

0 commit comments

Comments
 (0)