Skip to content

mvp_reducer: add frequency branch (rate(metric[5m])) — CountMin per-series ε - #343

Merged
zzylol merged 1 commit into
mainfrom
mvp/reducer-frequency-branch
May 8, 2026
Merged

zzylol merged 1 commit into
mainfrom
mvp/reducer-frequency-branch

Conversation

@zzylol

@zzylol zzylol commented May 8, 2026

Copy link
Copy Markdown
Contributor

PR #338 added frequency to the replay client but the reducer silently skipped those rows. This closes the gap.

  • _RATE_RE for rate(metric[5m]) shape
  • new extract_per_series helper for vector results
  • frequency branch in reduce_cell_via_archive: pair warm vs archive per-series, compute mean absolute additive error
  • frequency branch in archive_miss fallback so warm_answer captured for diagnostics

Refs #46. 🤖 Claude Code

…eries ε

PR #338 added frequency to the replay client's QUERY_KINDS but the reducer
silently skipped frequency rows because parse_query had no `rate()` regex.
This adds:

- `_RATE_RE` matching `rate(metric[5m])` shape
- parse_query returns ("frequency", {"metric": ...})
- new `extract_per_series` helper: PromQL vector → {labels-key → value}
- frequency branch in reduce_cell_via_archive: pair warm vs archive
  per-series, compute mean absolute additive error normalised by truth
  total — comparable column with rel_err for other kinds
- frequency branch in archive_miss fallback path so warm_answer is still
  captured for diagnostics

Refs #46. Closes the gap PR #338 flagged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol force-pushed the mvp/reducer-frequency-branch branch from 37bafa9 to ec7a6da Compare May 8, 2026 18:58
@zzylol
zzylol merged commit ff1454b into main May 8, 2026
@zzylol
zzylol deleted the mvp/reducer-frequency-branch branch May 9, 2026 18:00
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