/// Fetches the stats of all label value combinations of a `HistogramVec`, given
/// its name.
Fetches the stats of all label value combinations of a `HistogramVec`, given
its name.
Fetches the stats of all label value combinations of a ` HistogramVec ` given its name .
pub fn fetch_histogram_vec_stats(
    registry: &MetricsRegistry,
    name: &str,
) -> MetricVec<HistogramStats> {
    let mut stats = MetricVec::new();
    for metric_family in registry.prometheus_registry().gather() {
        if metric_family.get_name() == name {
            assert_eq!(MetricType::HISTOGRAM, metric_family.get_field_type());
            for metric in metric_family.get_metric() {
                stats.insert(
                    to_labels(metric),
                    HistogramStats {
                        count: metric.get_histogram().get_sample_count(),
                        sum: metric.get_histogram().get_sample_sum(),
                    },
                );
            }
            break;
        }
    }
    stats
}
pub fn fetch_histogram_vec_stats ( registry : & MetricsRegistry , name : & str , ) -> MetricVec < HistogramStats > { let mut stats = MetricVec :: new ( ) ; for metric_family in registry . prometheus_registry ( ) . gather ( ) { if metric_family . get_name ( ) == name { assert_eq ! ( MetricType HISTOGRAM metric_family get_field_type ( ) ) ; for metric in metric_family . get_metric ( ) { stats . insert ( to_labels ( metric ) , HistogramStats { count : metric . get_histogram ( ) . get_sample_count ( ) , sum : metric . get_histogram ( ) . get_sample_sum ( ) , } , ) ; } break ; } } stats }
Fetches the stats of all label value combinations of a `HistogramVec`, given
its name.
Fetches the stats of all label value combinations of a ` HistogramVec ` given its name .
registry
&MetricsRegistry
name
&str