Skip to content

Compono.Metrics.CapturedMeasurement T

Compono.Metrics

Compono.Metrics

CapturedMeasurement\<T> Struct

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.

public readonly struct CapturedMeasurement<T>
    where T : struct

Type parameters

T

The measurement's value type - one of the seven BCL measurement value types (System.Byte, System.Int16, System.Int32, System.Int64, System.Single, System.Double, System.Decimal).

Properties
Instrument The actual Instrument instance that recorded this measurement (the one the SUT created). Through System.Diagnostics.Metrics.Instrument.Meter it references the actual System.Diagnostics.Metrics.Meter, and through System.Diagnostics.Metrics.Meter.Scope the factory. Descriptive members (for example System.Diagnostics.Metrics.Instrument.Name, System.Diagnostics.Metrics.Instrument.Enabled, and the meter's name/version/tags) stay readable after the factory is disposed.
Tags This measurement's tags, copied out of the BCL's callback span in callback order. A per-measurement copy that never aliases the BCL's span or any other measurement's tags; empty (never null) when the measurement had no tags. Meter-level and instrument-level tags are not merged in - they're reachable through Instrument.
Value The recorded value, exactly as the instrument received it (no normalization, no aggregation).