MCPcopy Create free account
hub / github.com/cortexproject/cortex / ActiveUsers

Method ActiveUsers

pkg/util/users/active_user.go:97–107  ·  view source on GitHub ↗
(deadline int64)

Source from the content-addressed store, hash-verified

95}
96
97func (m *ActiveUsers) ActiveUsers(deadline int64) []string {
98 m.mu.RLock()
99 active := make([]string, 0, len(m.timestamps))
100 defer m.mu.RUnlock()
101 for userID, ts := range m.timestamps {
102 if ts.Load() > deadline {
103 active = append(active, userID)
104 }
105 }
106 return active
107}
108
109// ActiveUsersCleanupService tracks active users, and periodically purges inactive ones while running.
110type ActiveUsersCleanupService struct {

Callers 3

updateLabelSetMetricsMethod · 0.45
ActiveUsersMethod · 0.45

Calls 1

LoadMethod · 0.80

Tested by 1