Function prometheus_http_query::functions::increase [−][src]
pub fn increase(vector: RangeVector) -> InstantVector
Expand description
Apply the PromQL increase
function.
use prometheus_http_query::{Selector, RangeVector}; use prometheus_http_query::functions::increase; use std::convert::TryInto; fn main() -> Result<(), prometheus_http_query::Error> { let vector: RangeVector = Selector::new() .metric("some_metric")? .with("some_label", "some_value") .range("5m")? .try_into()?; let result = increase(vector); assert_eq!(&result.to_string(), "increase(some_metric{some_label=\"some_value\"}[5m])"); Ok(()) }