use of io.opencensus.metrics.export.MetricDescriptor in project instrumentation-java by census-instrumentation.
the class MetricUtilsTest method viewToMetricDescriptor.
@Test
public void viewToMetricDescriptor() {
MetricDescriptor metricDescriptor = MetricUtils.viewToMetricDescriptor(VIEW_1);
assertThat(metricDescriptor).isNotNull();
assertThat(metricDescriptor.getName()).isEqualTo(VIEW_NAME.asString());
assertThat(metricDescriptor.getUnit()).isEqualTo(MEASURE_UNIT);
assertThat(metricDescriptor.getType()).isEqualTo(Type.GAUGE_DOUBLE);
assertThat(metricDescriptor.getDescription()).isEqualTo(VIEW_DESCRIPTION);
assertThat(metricDescriptor.getLabelKeys()).containsExactly(LabelKey.create(KEY.getName(), ""));
}
Aggregations