Struct Dimension

Source
pub struct Dimension<'a> {
    pub id: &'a str,
    pub name: &'a str,
    pub algorithm: Option<Algorithm>,
    pub multiplier: Option<i32>,
    pub divisor: Option<i32>,
    pub options: Vec<DimensionOption>,
}
Expand description

Defines a new dimension for the Chart.

The template of this instruction looks like:

DIMENSION id [name [algorithm [multiplier [divisor [options]]]]]

See also: https://learn.netdata.cloud/docs/agent/collectors/plugins.d#dimension

The Display trait resp. the .to_string()-method should be used to compose the final command string

let d = Dimension{
    id: "test_id",
    name: "test_name",
    multiplier: Some(42),
    ..Dimension::default()
};
assert_eq!(d.to_string(), r#"DIMENSION "test_id" "test_name" "" "42""# );

Fields§

§id: &'a str

The id of this dimension (it is a text value, not numeric). It will be needed later to add values to the dimension.

We suggest to avoid using "." in dimension ids. External databases expect metrics to be "." separated and people will get confused if a dimension id contains a dot.

You can utilize validate() to prevent this kind of issue.

§name: &'a str

The name of the dimension as it will appear at the legend of the chart, if empty or missing the id will be used.

§algorithm: Option<Algorithm>

One of the Algorithm variantes.

§multiplier: Option<i32>

An integer value to multiply the collected value, if empty or missing, 1 is used.

§divisor: Option<i32>

An integer value to divide the collected value, if empty or missing, 1 is used.

§options: Vec<DimensionOption>

A list of options.

Options supported: obsolete to mark a dimension as obsolete (Netdata will delete it after some time) and hidden to make this dimension hidden, it will take part in the calculations but will not be presented in the chart.

Trait Implementations§

Source§

impl<'a> Clone for Dimension<'a>

Source§

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

Returns a copy 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 Dimension<'a>

Source§

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

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

impl<'a> Default for Dimension<'a>

Source§

fn default() -> Dimension<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Display for Dimension<'a>

This will generate the final command text string.

Optional fields will be communicated as empty string or simply skipped.

Source§

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

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

impl<'a> Validate for Dimension<'a>

Source§

impl<'v_a, 'a> ValidateArgs<'v_a> for Dimension<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Dimension<'a>

§

impl<'a> RefUnwindSafe for Dimension<'a>

§

impl<'a> Send for Dimension<'a>

§

impl<'a> Sync for Dimension<'a>

§

impl<'a> Unpin for Dimension<'a>

§

impl<'a> UnwindSafe for Dimension<'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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T