Struct Metric Envelope

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct MetricEnvelope {
    pub measurements: Vec<MetricMeasurement>,
}

Payload stored in a mark using METRIC_DATA_SCHEMA_NAME.

Fields

measurements: Vec<MetricMeasurement>

Metric recording operations that must be accepted or rejected atomically.

Implementations

impl MetricEnvelope

impl MetricEnvelope

builder

pub fn builder() -> MetricEnvelopeBuilder

Create a builder for building MetricEnvelope. On the builder, call .measurements(...) to set the values of the fields. Finally, call .build() to create the instance of MetricEnvelope.

impl MetricEnvelope

impl MetricEnvelope

validate

pub fn validate(&self) -> Result<(), MetricValidationError>

Validate every measurement and their shared instrument descriptors.

Errors

Returns a [MetricValidationError] when any field violates the Relay metric schema. The complete envelope must be rejected on error.

validated_measurements

pub fn validated_measurements(
    &self,
) -> Result<Vec<ValidatedMetricMeasurement>, MetricValidationError>

Parse this wire envelope into metric measurements safe for export.

Errors

Returns a [MetricValidationError] when any field violates the Relay metric schema. The complete envelope is rejected on error.

Trait Implementations

impl Clone for MetricEnvelope

impl Clone for MetricEnvelope

clone

fn clone(&self) -> MetricEnvelope

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for MetricEnvelope

impl Debug for MetricEnvelope

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

impl<'de> Deserialize<'de> for MetricEnvelope

impl<'de> Deserialize<'de> for MetricEnvelope

deserialize

fn deserialize<__D>(
    __deserializer: __D,
) -> Result<MetricEnvelope, <__D as Deserializer<'de>>::Error>where
    __D: Deserializer<'de>,

impl PartialEq for MetricEnvelope

impl PartialEq for MetricEnvelope

eq

fn eq(&self, other: &MetricEnvelope) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl Serialize for MetricEnvelope

impl Serialize for MetricEnvelope

serialize

fn serialize<__S>(
    &self,
    __serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
    __S: Serializer,

impl StructuralPartialEq for MetricEnvelope

impl StructuralPartialEq for MetricEnvelope