feat: add explicit default-aggregation to all metrics - #135
Conversation
Set default-aggregation on every numeric metric so aggregation semantics are self-documenting rather than relying on CDM's implicit sum fallback. Latency metrics (roundtrip, RTT, jitter, percentiles) get class=latency with max/avg/min as appropriate. Throughput and accumulative count metrics get sum. Percentage and utilization metrics get avg. Validated with STL run on nutanix-b: max-roundtrip returns worst port pair (4119) not sum (8235), ptp-latency min/max aggregate correctly across directions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run Review: ASTF Test with
|
| Category | Metrics | class | default-aggregation |
|---|---|---|---|
| Latency (worst-case) | tcp-rtt-max-usec |
latency |
max |
| Latency (best-case) | tcp-rtt-min-usec |
latency |
min |
| Latency (average) | tcp-rtt-avg-usec, tcp-rto-avg-usec |
latency |
avg |
| Throughput/rate | connections-per-second, connections-attempted-per-second, l7-tx-bps, l7-rx-bps, tx-bps, rx-bps, tx-pps, rx-pps |
throughput |
sum |
| Accumulative counts | tx-packets, rx-packets, server-accepts, server-connects, tcp-snd-bytes, tcp-rcv-bytes, active-flows, established-flows |
count |
sum |
| Percentage | tcp-overhead-pct |
count |
avg |
OpenSearch Indexing
Indexing succeeded (2,806,946 docs). The indexed metric_desc documents carry the correct default-aggregation values — all 21 unique metric type/class/aggregation combinations are present and match the post-processed data.
Observations
-
All ASTF metrics have correct aggregation — latency metrics properly use
class: latency(changed fromcount) with semantically correctmax/min/avg. -
No errors —
get-result-summary-stderr.txtis empty, no indexing failures. -
One minor note for PR review:
tcp-overhead-pcthasclass: countwithdefault-aggregation: avg. Theavgaggregation is correct for a percentage metric, but theclasscould arguably be something other thancount. This appears to be a pre-existing classification that the PR didn't change — worth noting but not a blocker. -
STL-specific metrics not exercised — This ASTF run doesn't exercise the STL device stats (9 metrics), ptp-latency stats (7), ptp-latency percentiles (7), or TRex profiler time-series (28). Those code paths would require an STL run to validate. The PR author already validated STL separately on nutanix-b.
Verdict
The ASTF path validates cleanly. The PR correctly adds default-aggregation to all ASTF metrics with semantically appropriate values, and the data flows through post-processing into OpenSearch without issues.
PR Code Review:
|
Summary
default-aggregationto every numeric metric in trafficgen-post-process.py so aggregation semantics are self-documentingclass: counttoclass: latencywith appropriate aggregation (max for worst-case, avg for pre-aggregated averages, min for best-case)sumavgsumCovers all 5 metric groups: STL device stats (9), ASTF stats (41), ptp-latency stats (7), ptp-latency percentiles (7), TRex profiler time-series (28).
Depends on CDM PR#202 (merged) — the
default-aggregationfield is accepted by both v9dev and v10dev, so this change is forward-compatible.Validated with STL run on nutanix-b:
max-roundtrip-usec: returns 4119 (max of port pairs), not 8235 (old sum behavior)mean-roundtrip-usec: returns 8.52 (avg)rx-pps: returns 29.7M (sum, unchanged)latency-max-usec: forward=7.75, reverse=8.00, aggregated=8.00 (max)latency-min-usec: forward=5.75, reverse=6.00, aggregated=5.75 (min)Test plan
🤖 Generated with Claude Code