Skip to content

fix(tui): correct computeThroughput timestamp unit from ms to seconds#728

Open
JeremyDev87 wants to merge 1 commit intomasterfrom
fix/throughput-timestamp-unit-697
Open

fix(tui): correct computeThroughput timestamp unit from ms to seconds#728
JeremyDev87 wants to merge 1 commit intomasterfrom
fix/throughput-timestamp-unit-697

Conversation

@JeremyDev87
Copy link
Owner

Summary

  • Fix computeThroughput dividing by 60000 (milliseconds) instead of 60 (seconds), causing throughput to display 1000x too high
  • ActivitySample.timestamp is stored in seconds by the reducer (use-dashboard-state.ts:236), but computeThroughput assumed milliseconds
  • Update test data to use second-based timestamps matching actual reducer output
  • Add reverse-order timestamp guard test

Test plan

  • All 31 tests in live.pure.spec.ts pass
  • lint, format, typecheck, test:coverage, circular, build all pass
  • Manual verification: run TUI dashboard and confirm throughput shows realistic values (e.g., 5.0/min instead of 5000.0/min)

Closes #697

ActivitySample.timestamp is stored in seconds by the reducer
(use-dashboard-state.ts:236), but computeThroughput divided by 60000
assuming milliseconds — causing throughput to display 1000x too high.

- Change divisor from 60000 to 60 in computeThroughput
- Update test data to use second-based timestamps (60000→60, 30000→30)
- Add reverse-order timestamp guard test

Closes #697
@JeremyDev87 JeremyDev87 added the bug Something isn't working label Mar 20, 2026
@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Mar 20, 2026 9:12am

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.

bug(tui): computeThroughput timestamp unit mismatch — throughput displayed 1000x too high

1 participant