Garrett Delfosse
Garrett Delfosse
> Modify codersdk.TrackWorkspaceUsageContext to accept argument to specify app_name.
> Modify api.patchTemplateMeta and api.putExtendWorkspace (/extend)to call the previously added StatsDBReporter.TrackFlush() method.
> - Modify `/usage` endpoint to call `workspaceapps.StatsCollector.Collect()` > - The `workspaceusage` package at this point can be removed.
> - Modify `/usage` endpoint to accept an optional payload `workspaceapps.StatsReport` > - If payload is present, use payload contents for tracking workspace usage > - If payload is not...
> - In `StatsAPI`, modify `UpdateStats` to call `workspaceapps.StatsCollector.Collect()` converting the `agentapi.Stats` into `workspaceapps.StatsReport` > - The main fields we are interested in here are the `SessionCount` by `ssh`, `sftp`,...
> - Add the capability for `StatsDBReporter` to track and *immediately* flush usage for a *single* workspace. This is in order for the `api.patchTemplateMeta` endpoint to stop calling `UpdateWorkspaceLastUsedAt` directly....
> - Modify `StatsDBReporter` to notify for each workspace that has had its deadline or LastUsedAt bumped. - We may wish to decrease the stats reporting interval to 60 seconds...
> The simplest option available to us is to make `workspaceapps.StatsCollector` the single entity responsible for performing the following database queries: > > - `ActivityBumpWorkspace` > - `UpdateWorkspaceLastUsedAt` / `BatchUpdateWorkspaceLastUsedAt`...