[][src]Struct appinsights::telemetry::AggregateMetricTelemetry

pub struct AggregateMetricTelemetry { /* fields omitted */ }

Aggregated metric telemetry item that represents an aggregation of data points over time. There values can be calculated by the caller or with add_data or add_sampled_data method.

Examples

use appinsights::telemetry::{Telemetry, AggregateMetricTelemetry};

// create a telemetry item
let mut telemetry = AggregateMetricTelemetry::new("temp_sensor".into());
telemetry.stats_mut().add_data(&[50.0, 53.1, 56.4]);

// assign custom properties and context tags
telemetry.properties_mut().insert("component".to_string(), "external_device".to_string());
telemetry.tags_mut().insert("os_version".to_string(), "linux x86_64".to_string());

// submit telemetry item to server
client.track(telemetry);

Methods

impl AggregateMetricTelemetry[src]

pub fn new(name: String) -> Self[src]

Creates a metric telemetry item with specified name and value.

pub fn stats(&self) -> &Stats[src]

Returns aggregated metric to submit with the telemetry item.

pub fn stats_mut(&mut self) -> &mut Stats[src]

Returns mutable reference to aggregated metric.

Trait Implementations

impl Telemetry for AggregateMetricTelemetry[src]

fn timestamp(&self) -> DateTime<Utc>[src]

Returns the time when this telemetry was measured.

fn properties(&self) -> &Properties[src]

Returns custom properties to submit with the telemetry item.

fn properties_mut(&mut self) -> &mut Properties[src]

Returns mutable reference to custom properties.

fn tags(&self) -> &ContextTags[src]

Returns context data containing extra, optional tags. Overrides values found on client telemetry context.

fn tags_mut(&mut self) -> &mut ContextTags[src]

Returns mutable reference to custom tags.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,