#[non_exhaustive]pub enum MetricExpr {
Series(Series),
Function {
name: FuncKind,
arg: Box<MetricExpr>,
params: Vec<FuncParam>,
},
Transform {
name: String,
arg: Box<MetricExpr>,
args: Vec<Scalar>,
},
Arith {
op: ArithOp,
lhs: Box<MetricExpr>,
rhs: Box<MetricExpr>,
},
Change {
kind: ChangeKind,
inner_agg: TimeAgg,
shift: Window,
arg: Box<MetricExpr>,
},
Scalar(Scalar),
}Expand description
The recursive metric expression — the tree a visualization renders.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Series(Series)
A scoped metric: space_agg:metric.name{filter} by {tags}.modifiers.
Function
An evaluation function: anomalies / outliers / forecast.
Fields
§
arg: Box<MetricExpr>The inner expression the function evaluates.
Transform
A transform such as rollup / clamp_min / median_N / abs.
Fields
§
arg: Box<MetricExpr>The inner expression being transformed.
Arith
Arithmetic: a + b, a / b * 100, etc.
Change
change() / pct_change() over a window shift.
Fields
§
kind: ChangeKindWhether this is an absolute or percentage change.
§
arg: Box<MetricExpr>The inner expression.
Scalar(Scalar)
A literal scalar operand (for arithmetic).
Trait Implementations§
Source§impl Clone for MetricExpr
impl Clone for MetricExpr
Source§fn clone(&self) -> MetricExpr
fn clone(&self) -> MetricExpr
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricExpr
impl Debug for MetricExpr
Source§impl<'de> Deserialize<'de> for MetricExpr
impl<'de> Deserialize<'de> for MetricExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MetricExpr
impl PartialEq for MetricExpr
Source§fn eq(&self, other: &MetricExpr) -> bool
fn eq(&self, other: &MetricExpr) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MetricExpr
impl Serialize for MetricExpr
impl StructuralPartialEq for MetricExpr
Auto Trait Implementations§
impl Freeze for MetricExpr
impl RefUnwindSafe for MetricExpr
impl Send for MetricExpr
impl Sync for MetricExpr
impl Unpin for MetricExpr
impl UnsafeUnpin for MetricExpr
impl UnwindSafe for MetricExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more