feat: Metrics Reducer Implementation (TASK-401)#96
Merged
copyleftdev merged 2 commits intomainfrom Jan 11, 2026
Merged
Conversation
Implements post-run metrics computation from event log with single-pass O(N) algorithm per METRICS.md specification. Metrics computed: - Request metrics (total, success, failed, by method, by status class) - Latency metrics (min, max, mean, p50, p90, p95, p99, p999) - Throughput metrics (duration, requests per tick) - Connection metrics (count, errors, avg connection time) - Error metrics (total, by type, error rate) Also includes HDR Histogram (TASK-400 dependency) for latency percentiles: - Pure Zig implementation with bounded memory (~260KB) - Configurable precision (1-5 significant figures) - O(1) value recording and percentile queries 22 metrics tests + 30 HDR histogram tests, all passing. Tiger Style compliant with 2+ assertions per function. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
b49d6ee to
743db7d
Compare
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TASK-401 requires post-run metrics computation from the event log. Need to compute request counts, latency distribution, throughput, connection metrics, and error rates in a single O(N) pass for performance.
Solution
MetricsReducer implementation with single-pass O(N) algorithm:
Also includes HDR Histogram (TASK-400 dependency) for accurate latency percentiles.
Testing
Changes
src/metrics.zig- MetricsReducer implementationsrc/hdr_histogram.zig- HDR Histogram for latency percentilestests/unit/metrics_test.zig- 22 unit teststests/unit/hdr_histogram_test.zig- 30 unit testssrc/z6.zig- Export typesbuild.zig- Add test targets🤖 Generated with Claude Code