Struct glean_core::metrics::CustomDistributionMetric[][src]

pub struct CustomDistributionMetric { /* fields omitted */ }
Expand description

A custom distribution metric.

Memory distributions are used to accumulate and store memory sizes.

Implementations

Creates a new memory distribution metric.

Accumulates the provided signed samples in the metric.

This is required so that the platform-specific code can provide us with 64 bit signed integers if no u64 comparable type is available. This will take care of filtering and reporting errors for any provided negative sample.

Arguments

  • samples - The vector holding the samples to be recorded by the metric.

Notes

Discards any negative value in samples and report an ErrorType::InvalidValue for each of them.

Test-only API (exported for FFI purposes).

Gets the currently stored histogram.

This doesn’t clear the stored value.

Test-only API (exported for FFI purposes).

Gets the currently stored histogram as a JSON String of the serialized value.

This doesn’t clear the stored value.

Trait Implementations

Formats the value using the given formatter. Read more

Access the stored metadata

Access the stored metadata mutable

Whether this metric should currently be recorded Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.