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> Display for Dimension<'a>
This will generate the final command text string.
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.