Struct ValueList

Source
pub struct ValueList<'a> {
    pub values: Vec<ValueReport<'a>>,
    pub plugin: &'a str,
    pub plugin_instance: Option<&'a str>,
    pub type_: &'a str,
    pub type_instance: Option<&'a str>,
    pub host: &'a str,
    pub time: DateTime<Utc>,
    pub interval: Duration,
    pub meta: HashMap<String, MetaValue>,
    /* private fields */
}
Expand description

Contains values and metadata that collectd has collected from plugins

Fields§

§values: Vec<ValueReport<'a>>§plugin: &'a str

The plugin that submitted this value. This would be your PluginManager when submitting values

§plugin_instance: Option<&'a str>

Distinguishes entities that yield metrics. Each core would be a different instance of the same plugin, as each core reports “idle”, “user”, “system” metrics.

§type_: &'a str

This is the string found in types.db, determines how many values are expected and how they should be interpreted

§type_instance: Option<&'a str>

The type instance is used to separate values of identical type which nonetheless belong to one another. For instance, even though “free”, “used”, and “total” all have types of “Memory” they are different type instances.

§host: &'a str

The hostname where the values were collectd

§time: DateTime<Utc>

The timestamp at which the value was collected

§interval: Duration

The interval in which new values are to be expected

§meta: HashMap<String, MetaValue>

Metadata associated to the reported values

Implementations§

Source§

impl<'a> ValueList<'a>

Source

pub fn rates(&self) -> Result<Cow<'_, Vec<ValueReport<'a>>>, CacheRateError>

Collectd does not automatically convert Derived values into a rate. This is why many write plugins have a StoreRates config option so that these rates are calculated on demand from collectd’s internal cache. This function will return a vector that can supercede the values field that contains the rate of all non-gauge values. Values that are gauges remain unchanged, so one doesn’t need to resort back to values field as this function will return everything prepped for submission.

Source

pub fn from<'b>( set: &'b data_set_t, list: &'b value_list_t, ) -> Result<ValueList<'b>, ReceiveError>

Trait Implementations§

Source§

impl<'a> Clone for ValueList<'a>

Source§

fn clone(&self) -> ValueList<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ValueList<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for ValueList<'a>

Source§

fn eq(&self, other: &ValueList<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for ValueList<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ValueList<'a>

§

impl<'a> RefUnwindSafe for ValueList<'a>

§

impl<'a> !Send for ValueList<'a>

§

impl<'a> !Sync for ValueList<'a>

§

impl<'a> Unpin for ValueList<'a>

§

impl<'a> UnwindSafe for ValueList<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.