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