Skip to content

test: add unit tests for perf-metrics module#175

Open
Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Bortlesboat:test-perf-metrics-coverage
Open

test: add unit tests for perf-metrics module#175
Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Bortlesboat:test-perf-metrics-coverage

Conversation

@Bortlesboat
Copy link

Summary

  • Add 12 unit tests covering all public exports of src/perf-metrics.ts
  • Functions tested: incrementPerfCounter, setPerfGauge, recordPerfDuration, measurePerf, startPerfTimer, getPerfMetricsSnapshot, resetPerfMetrics, formatPerfMetric
  • Includes edge cases: custom deltas, rounding to 3 decimal places, duration recording when the wrapped function throws

Test plan

  • All 12 new tests pass
  • oxlint, oxfmt, tsc --noEmit clean
  • No production code changes

Cover all public exports: incrementPerfCounter, setPerfGauge,
recordPerfDuration, measurePerf, startPerfTimer, getPerfMetricsSnapshot,
resetPerfMetrics, and formatPerfMetric. Includes edge cases for custom
deltas, rounding precision, and duration recording on thrown errors.
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