(windowSize time.Duration)
| 63 | } |
| 64 | |
| 65 | func (s StatsReport) groupKey(windowSize time.Duration) statsGroupKey { |
| 66 | return statsGroupKey{ |
| 67 | StartTimeTrunc: s.SessionStartedAt.Truncate(windowSize), |
| 68 | UserID: s.UserID, |
| 69 | WorkspaceID: s.WorkspaceID, |
| 70 | AgentID: s.AgentID, |
| 71 | AccessMethod: s.AccessMethod, |
| 72 | SlugOrPort: s.SlugOrPort, |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // StatsCollector collects workspace app StatsReports and reports them |
| 77 | // in batches, stats compaction is performed for short-lived sessions. |