Skip to content

Conversation

@amrit110
Copy link
Member

This pull request adds support for tracking and displaying "active hours"—the sum of actual user interaction time (excluding idle time) as reported by the Coder Insights API—across workspace, team, and template analytics. The backend collection script is updated to fetch and enrich workspaces with active hours, and the frontend is updated to show and sort by this new metric in relevant tables. These changes provide a more accurate view of user engagement beyond simple connection time.

Backend: Collection and Data Enrichment

  • Added fetch_user_activity_insights function to scripts/collect_coder_analytics.py to retrieve active hours per user from the Coder Insights API and integrated this data into workspace enrichment. [1] [2] [3]
  • Updated workspace enrichment and aggregation logic in metrics.ts to include active_hours in workspace, team, and template metrics. [1] [2] [3] [4] [5] [6] [7]

Data Types and Interfaces

  • Added active_hours field to CoderWorkspace, WorkspaceMetrics, TeamMetrics, and TemplateMetrics interfaces in types.ts to support the new metric throughout the codebase. [1] [2] [3] [4]

Frontend: Display and Sorting

Documentation and Messaging

  • Improved docstrings and progress messages to clarify that both build history and active hours are now included in analytics. [1] [2]

These changes collectively enable a more meaningful analysis of workspace usage by distinguishing actual user engagement from mere connection time.

@amrit110 amrit110 self-assigned this Dec 10, 2025
@amrit110 amrit110 added the enhancement New feature or request 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 (5645860) to head (aa295bd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #45   +/-   ##
=======================================
  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 f0c6c64 into main Dec 10, 2025
8 checks passed
@amrit110 amrit110 deleted the add_active_hours branch December 10, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants