Function prometheus_http_query::functions::quantile_over_time [−][src]
pub fn quantile_over_time(quantile: f64, vector: RangeVector) -> InstantVector
Expand description
Apply the PromQL quantile_over_time
function.
use prometheus_http_query::{Selector, RangeVector};
use prometheus_http_query::functions::quantile_over_time;
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 = quantile_over_time(0.95, vector);
assert_eq!(&result.to_string(), "quantile_over_time(0.95, some_metric{some_label=\"some_value\"}[5m])");
Ok(())
}