Struct collectd_plugin::ValueListBuilder
source · pub struct ValueListBuilder<'a> { /* private fields */ }
Expand description
Creates a value list to report values to collectd.
Implementations§
source§impl<'a> ValueListBuilder<'a>
impl<'a> ValueListBuilder<'a>
sourcepub fn new<T: Into<&'a str>, U: Into<&'a str>>(
plugin: T,
type_: U
) -> ValueListBuilder<'a>
pub fn new<T: Into<&'a str>, U: Into<&'a str>>(
plugin: T,
type_: U
) -> ValueListBuilder<'a>
Primes a value list for submission. plugin
will most likely be the name from the
PluginManager
and type_
is the datatype found in types.db
sourcepub fn values(self, values: &'a [Value]) -> ValueListBuilder<'a>
pub fn values(self, values: &'a [Value]) -> ValueListBuilder<'a>
A set of observed values that belong to the same plugin and type instance
sourcepub fn plugin_instance<T: Into<&'a str>>(
self,
plugin_instance: T
) -> ValueListBuilder<'a>
pub fn plugin_instance<T: Into<&'a str>>(
self,
plugin_instance: T
) -> ValueListBuilder<'a>
Distinguishes entities that yield metrics. Each core would be a different instance of the same plugin, as each core reports “idle”, “user”, “system” metrics.
sourcepub fn type_instance<T: Into<&'a str>>(
self,
type_instance: T
) -> ValueListBuilder<'a>
pub fn type_instance<T: Into<&'a str>>(
self,
type_instance: T
) -> ValueListBuilder<'a>
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.
sourcepub fn host<T: Into<&'a str>>(self, host: T) -> ValueListBuilder<'a>
pub fn host<T: Into<&'a str>>(self, host: T) -> ValueListBuilder<'a>
Override the machine’s hostname that the observed values will be attributed to. Best to override when observing values from another machine
sourcepub fn time(self, dt: DateTime<Utc>) -> ValueListBuilder<'a>
pub fn time(self, dt: DateTime<Utc>) -> ValueListBuilder<'a>
The timestamp at which the value was collected. Overrides the default time, which is when
collectd receives the values from submit
. Use only if there is a significant delay is
metrics gathering or if submitting values from the past.
sourcepub fn interval(self, interval: Duration) -> ValueListBuilder<'a>
pub fn interval(self, interval: Duration) -> ValueListBuilder<'a>
The interval in which new values are to be expected. This is typically handled at a global or plugin level. Use at your own discretion.
Trait Implementations§
source§impl<'a> Clone for ValueListBuilder<'a>
impl<'a> Clone for ValueListBuilder<'a>
source§fn clone(&self) -> ValueListBuilder<'a>
fn clone(&self) -> ValueListBuilder<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more