Skip to content

fix: use user CPU time for process_cpu_seconds_user_total on Windows#124

Merged
f41gh7 merged 1 commit intomasterfrom
fix/windows-user-cpu-metric
Apr 15, 2026
Merged

fix: use user CPU time for process_cpu_seconds_user_total on Windows#124
f41gh7 merged 1 commit intomasterfrom
fix/windows-user-cpu-metric

Conversation

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot commented Apr 13, 2026

Summary

  • Fixed process_cpu_seconds_user_total on Windows reporting system CPU time (stimeSeconds) instead of user CPU time (utimeSeconds)
  • This made the user and system CPU metrics identical, breaking the user/system CPU breakdown in monitoring dashboards

Root Cause

Copy-paste error in process_metrics_windows.go:60 — the third WriteCounterFloat64 call used stimeSeconds where it should have used utimeSeconds. The Linux implementation (process_metrics_linux.go:89) correctly uses utime.

Test plan

  • go test ./... passes
  • go vet ./... clean
  • GOOS=windows go vet ./... clean

🤖 Generated with Claude Code


Summary by cubic

Fixes process_cpu_seconds_user_total on Windows to report user CPU time instead of system time. Restores correct user/system CPU breakdown in dashboards.

  • Bug Fixes
    • Corrected process_metrics_windows.go to use utimeSeconds for process_cpu_seconds_user_total (was incorrectly using stimeSeconds).

Written for commit 6bea0d2. Summary will update on new commits.

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (5dbd3cd) to head (6bea0d2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   88.14%   88.14%           
=======================================
  Files          12       12           
  Lines        1392     1392           
=======================================
  Hits         1227     1227           
  Misses        114      114           
  Partials       51       51           

☔ 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.

@f41gh7 f41gh7 self-assigned this Apr 14, 2026
@f41gh7 f41gh7 requested review from f41gh7 and hagen1778 April 14, 2026 09:42
Copy link
Copy Markdown
Contributor

@f41gh7 f41gh7 left a comment

Choose a reason for hiding this comment

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

LGTM

@f41gh7 f41gh7 merged commit ed35abd into master Apr 15, 2026
30 of 31 checks passed
@f41gh7 f41gh7 deleted the fix/windows-user-cpu-metric branch April 15, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant