Skip to content

chore: move stat reporting into workspacestats package #13386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2024

Conversation

f0ssel
Copy link
Contributor

@f0ssel f0ssel commented May 28, 2024

Part of #13279

  • Removes workspaceapps.StatsDBReporter in favor of new workspacestats.Reporter
  • Changes workspaceapps.StatsReporter interface method name for clarity
  • workspaceapps.StatsCollector now uses workspacestats.Reporter.ReportAppStats()
  • The agent API and legacy API routes now use workspacestats.Reporter.ReportAgentStats()

This is primarily just moving code, the only functional change here is that the legacy agent API routes previously only bumped last_used_at if there was a tracked "session connection"`, but this diverges from our new agent API where we always bump it. The behavior is now unified to always bump the field since the legacy API is on the way out.

@f0ssel f0ssel marked this pull request as ready for review May 28, 2024 18:31
@f0ssel f0ssel requested a review from johnstcn May 28, 2024 18:31
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and the tests also appear to be happy.

It's nice that we now have unified behaviour between the legacy HTTP and dRPC agent APIs.

@f0ssel f0ssel merged commit 5789ea5 into main May 29, 2024
27 checks passed
@f0ssel f0ssel deleted the f0ssel/workspacestats branch May 29, 2024 15:49
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants