pub struct PublishMetric { /* private fields */ }Expand description
A structure for creating a metric to be published with associated metadata and properties.
PublishMetric provides a builder pattern for configuring metric publications,
allowing for optional fields like transience, historical status, custom timestamps,
metadata, and properties.
Implementations§
Source§impl PublishMetric
impl PublishMetric
Sourcepub fn timestamp(self, timestamp: u64) -> Self
pub fn timestamp(self, timestamp: u64) -> Self
Sets a custom timestamp for the metric.
By default, the current system time is used.
Sourcepub fn transient(self, is_transient: bool) -> Self
pub fn transient(self, is_transient: bool) -> Self
Marks the metric as transient or persistent.
Transient metrics are typically not stored permanently. By default metrics are not transient.
Sourcepub fn historical(self, is_historical: bool) -> Self
pub fn historical(self, is_historical: bool) -> Self
Marks the metric as a historical metric that does not represent a current value.
By default, metrics are not historical.
Sourcepub fn metadata(self, metadata: MetaData) -> Self
pub fn metadata(self, metadata: MetaData) -> Self
Sets custom metadata for the metric.
By default, the result from MetricValue::publish_metadata will be used.
Sourcepub fn properties<P: Into<PropertySet>>(self, properties: P) -> Self
pub fn properties<P: Into<PropertySet>>(self, properties: P) -> Self
Sets custom properties for the metric.