| 17 | ) |
| 18 | |
| 19 | type StatsAPI struct { |
| 20 | AgentID uuid.UUID |
| 21 | AgentName string |
| 22 | Workspace *CachedWorkspaceFields |
| 23 | Database database.Store |
| 24 | Log slog.Logger |
| 25 | StatsReporter *workspacestats.Reporter |
| 26 | AgentStatsRefreshInterval time.Duration |
| 27 | Experiments codersdk.Experiments |
| 28 | |
| 29 | TimeNowFn func() time.Time // defaults to dbtime.Now() |
| 30 | } |
| 31 | |
| 32 | func (a *StatsAPI) now() time.Time { |
| 33 | if a.TimeNowFn != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected