Skip to content

Correct cost, latency and outcome counts in saved results - #22

Merged
cynkai merged 2 commits into
mainfrom
codex/report-operation-metrics
Dec 2, 2026
Merged

cynkai merged 2 commits into
mainfrom
codex/report-operation-metrics

Conversation

@cynkai

@cynkai cynkai commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Changes

Saved results can store cost, latency and boolean flags as text. The report previously counted costs of "1" and "2" as $12, and text latency or success flags could prevent report generation.

  • Compute cost and mean latency from valid observations across all attempts, including error rows. The dashboard marks partial cost as a subtotal and reports the number of observations for each metric. JSON preserves recorded zero and uses null for unavailable metrics.
  • Parse boolean and 0/1 fields consistently. A missing flag yields an unknown count when it affects the answer. Historical category statistics using flags alone exclude unrecorded outcomes.

Verification

  • Verified the same 22 KPIs for both published reference CSVs using pandas type inference and literal-text ingestion.
  • Reopened a neutral three-row fixture through the Streamlit report and checked the $3 subtotal, 150 ms mean, per-metric coverage, CSV content, JSON values and generated PDF.
  • All 351 tests passed locally. Pyflakes and git diff --check passed.

@cynkai
cynkai merged commit 55bdbb5 into main Dec 2, 2026
2 checks passed
@cynkai
cynkai deleted the codex/report-operation-metrics branch December 2, 2026 12:17
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