Skip to content

Conversation

@amrit110
Copy link
Member

This pull request updates how workspace usage hours are calculated and displayed throughout the analytics service. Instead of measuring workspace lifetime from creation to now, the metrics now reflect the actual usage window, defined as the time between the first and last agent connections. This provides a more accurate representation of workspace activity for templates and teams.

Metrics calculation improvements:

  • Added a new function calculateWorkspaceUsageHours in metrics.ts to compute usage hours based on the window from the first to the last agent connection, replacing the previous method that used workspace creation time to now.
  • Updated the enrichWorkspaceData function in metrics.ts to use the new usage hours calculation for each workspace.

Documentation and interface updates:

  • Updated comments and field descriptions in WorkspaceMetrics, TeamMetrics, and TemplateMetrics interfaces in types.ts to clarify that workspace hours are now based on usage (first to last connection) rather than lifetime. [1] [2] [3]

User interface improvements:

@amrit110 amrit110 self-assigned this Dec 10, 2025
@amrit110 amrit110 added the bug Something isn't working label Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.09%. Comparing base (a0ddf68) to head (384173c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #44   +/-   ##
=======================================
  Coverage   88.09%   88.09%           
=======================================
  Files           3        3           
  Lines         462      462           
=======================================
  Hits          407      407           
  Misses         55       55           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amrit110 amrit110 merged commit 5645860 into main Dec 10, 2025
8 checks passed
@amrit110 amrit110 deleted the fix_usage_metrics branch December 10, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants