use of io.opencensus.metrics.data.Exemplar in project instrumentation-java by census-instrumentation.
the class DistributionTest method createAndGet_Exemplar.
@Test
public void createAndGet_Exemplar() {
Exemplar exemplar = Exemplar.create(-9.9, TIMESTAMP, ATTACHMENTS);
assertThat(exemplar.getValue()).isWithin(TOLERANCE).of(-9.9);
assertThat(exemplar.getTimestamp()).isEqualTo(TIMESTAMP);
assertThat(exemplar.getAttachments()).isEqualTo(ATTACHMENTS);
}
use of io.opencensus.metrics.data.Exemplar in project instrumentation-java by census-instrumentation.
the class DistributionTest method createAndGet_BucketWithExemplar.
@Test
public void createAndGet_BucketWithExemplar() {
Exemplar exemplar = Exemplar.create(12.2, TIMESTAMP, ATTACHMENTS);
Bucket bucket = Bucket.create(7, exemplar);
assertThat(bucket.getCount()).isEqualTo(7);
assertThat(bucket.getExemplar()).isEqualTo(exemplar);
}
Aggregations