Skip to content

Compono.Metrics

Compono.Metrics

Compono.Metrics Namespace

Classes
CapturingMeterFactory A hand-written, reflection-free System.Diagnostics.Metrics.IMeterFactory that captures the measurements of every instrument its meters publish into an inspectable, thread-safe, Compono-native model (CapturedMeasurement<T>). Directly, publicly constructible - composing through UseMetrics(this CompositionBuilder) is not required. See docs/adr/0072-compono-metrics-testing-support-package.md.
CompositionBuilderExtensions Registers Compono.Metrics support into a CompositionBuilder.
MeasurementVerificationBuilder<T> A fluent filter chain over a resolved selection of captured measurements, ending in a thin, one-line forwarder to core CallVerifier - Once()/Never()/Exactly(int) each build a CallVerifier from the filtered match count right here and call the corresponding member. CallVerifier itself is never part of this type's public surface, and no new counting/Times abstraction is introduced. See docs/adr/0072-compono-metrics-testing-support-package.md ยง"Selection and matching".
MeterFactoryTestingExtensions Direct inspection and fluent verification over any System.Diagnostics.Metrics.IMeterFactory - no assertion framework required. Every method here requires the System.Diagnostics.Metrics.IMeterFactory it's called on to actually be a CapturingMeterFactory (produced by UseMetrics(this CompositionBuilder), or directly via CapturingMeterFactory's public constructor) - calling any of these against a substitute, a Compono.TestDoubles-generated double, DefaultMeterFactory, or any other non-Compono System.Diagnostics.Metrics.IMeterFactory throws immediately, diagnostically, rather than returning an empty/default result. See docs/adr/0072-compono-metrics-testing-support-package.md's "Precedence and misuse" section.
Structs
CapturedMeasurement<T> A single captured measurement: the recorded value, its tags, and the Instrument that recorded it. A plain readonlystruct - deliberately not a recordstruct, so there is no synthesized value equality that would suggest == compares Tags by value; use Value directly or the Verify<T>(this IMeterFactory, string) filter chain. See docs/adr/0072-compono-metrics-testing-support-package.md.