Add dimension-aware query helpers to TestMetrics #231
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.48) × (1 − Review Confidence (0.44)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 202 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.318
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 comments
"Review active on #231"
general
weight: 0.35
krishnapermi
Closes apple/swift-metrics#230
Motivation
Testing code that emits metrics with dimensions is more boilerplate than it should be. The existing
expectCounter(_:_:)API requires an exact label+dimensions match, so looking up all counters for a given label across any dimension set means manually filteringmetrics.counters:I noticed this while writing tests for a service that tags every metric with HTTP method and status dimensions —
expectCounterwas completely unusable across dimension variants, forcing me to hand-roll every lookup.Changes
Adds two overloads per instrument type (
Counter,Meter,Recorder,Timer):counters(label:)— returns every counter with the given label, regardless of dimensionscounters(label:dimensions:)— returns every counter with the given label whose dimension set is a superset of the specified pairs (counters with extra dimensions are still matched)Same pattern for
meters,recorders, andtimers.Example