Table of Contents

Class CapturedMeasurement

Namespace
MetricsAssertions
Assembly
MetricsAssertions.dll

A single captured metric measurement, normalized for assertions: the instrument it came from, its numeric value (any instrument value type, projected to double for uniform querying), the tags attached to it, and the time it was collected.

public sealed record CapturedMeasurement : IEquatable<CapturedMeasurement>
Inheritance
CapturedMeasurement
Implements
Inherited Members

Constructors

CapturedMeasurement(string, double, IReadOnlyDictionary<string, object?>, DateTimeOffset)

A single captured metric measurement, normalized for assertions: the instrument it came from, its numeric value (any instrument value type, projected to double for uniform querying), the tags attached to it, and the time it was collected.

public CapturedMeasurement(string InstrumentName, double Value, IReadOnlyDictionary<string, object?> Tags, DateTimeOffset Timestamp)

Parameters

InstrumentName string

The name of the instrument that emitted the measurement.

Value double

The measured value, projected to double for uniform querying. double represents integers exactly only up to 2^53 and cannot represent every decimal exactly, so an exact-equality assertion on a very large long counter or a decimal (for example money-as-metric) histogram can surprise; prefer the tolerance-based sample assertions for non-integer values.

Tags IReadOnlyDictionary<string, object>

The tags attached to the measurement (empty when none).

Timestamp DateTimeOffset

The time the measurement was collected (from the capturing collector's clock).

Properties

InstrumentName

The name of the instrument that emitted the measurement.

public string InstrumentName { get; init; }

Property Value

string

Tags

The tags attached to the measurement (empty when none).

public IReadOnlyDictionary<string, object?> Tags { get; init; }

Property Value

IReadOnlyDictionary<string, object>

Timestamp

The time the measurement was collected (from the capturing collector's clock).

public DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

Value

The measured value, projected to double for uniform querying. double represents integers exactly only up to 2^53 and cannot represent every decimal exactly, so an exact-equality assertion on a very large long counter or a decimal (for example money-as-metric) histogram can surprise; prefer the tolerance-based sample assertions for non-integer values.

public double Value { get; init; }

Property Value

double