use of io.prometheus.client.Collector.MetricFamilySamples in project instrumentation-java by census-instrumentation.
the class PrometheusStatsCollectorTest method testCollect.
@Test
public void testCollect() {
PrometheusStatsCollector collector = new PrometheusStatsCollector(mockMetricProducerManager, "");
assertThat(collector.collect()).containsExactly(new MetricFamilySamples(METRIC_NAME, Type.HISTOGRAM, METRIC_DESCRIPTION, Arrays.asList(new Sample(METRIC_NAME + "_bucket", Arrays.asList("k1", "k2", "le"), Arrays.asList("v1", "v2", "1.0"), 0), new Sample(METRIC_NAME + "_bucket", Arrays.asList("k1", "k2", "le"), Arrays.asList("v1", "v2", "2.0"), 2), new Sample(METRIC_NAME + "_bucket", Arrays.asList("k1", "k2", "le"), Arrays.asList("v1", "v2", "5.0"), 4), new Sample(METRIC_NAME + "_bucket", Arrays.asList("k1", "k2", "le"), Arrays.asList("v1", "v2", "+Inf"), 5), new Sample(METRIC_NAME + "_count", Arrays.asList("k1", "k2"), Arrays.asList("v1", "v2"), 5), new Sample(METRIC_NAME + "_sum", Arrays.asList("k1", "k2"), Arrays.asList("v1", "v2"), 22.0))));
}
Aggregations