Rename Point to PointData to suggest that it represents data reprezentation (#2519)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
Bogdan Drutu 2021-01-13 20:05:40 -08:00 committed by GitHub
parent 6bee59e912
commit cbcec6b359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 379 additions and 330 deletions

View File

@ -12,7 +12,7 @@ import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.export.MetricExporter; import io.opentelemetry.sdk.metrics.export.MetricExporter;
@ -39,7 +39,7 @@ class OtlpJsonLoggingMetricExporterTest {
DoubleSumData.create( DoubleSumData.create(
true, true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList(DoublePoint.create(1, 2, Labels.of("cat", "meow"), 4)))); Arrays.asList(DoublePointData.create(1, 2, Labels.of("cat", "meow"), 4))));
private static final MetricData METRIC2 = private static final MetricData METRIC2 =
MetricData.createDoubleSum( MetricData.createDoubleSum(
@ -51,7 +51,7 @@ class OtlpJsonLoggingMetricExporterTest {
DoubleSumData.create( DoubleSumData.create(
true, true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList(DoublePoint.create(1, 2, Labels.of("cat", "meow"), 4)))); Arrays.asList(DoublePointData.create(1, 2, Labels.of("cat", "meow"), 4))));
@RegisterExtension @RegisterExtension
LogCapturer logs = LogCapturer.create().captureForType(OtlpJsonLoggingMetricExporter.class); LogCapturer logs = LogCapturer.create().captureForType(OtlpJsonLoggingMetricExporter.class);

View File

@ -12,11 +12,11 @@ import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
@ -62,7 +62,7 @@ class LoggingMetricExporterTest {
"ms", "ms",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
nowEpochNanos, nowEpochNanos,
nowEpochNanos + 245, nowEpochNanos + 245,
Labels.of("a", "b", "c", "d"), Labels.of("a", "b", "c", "d"),
@ -81,7 +81,7 @@ class LoggingMetricExporterTest {
true, true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
nowEpochNanos, nowEpochNanos,
nowEpochNanos + 245, nowEpochNanos + 245,
Labels.of("z", "y", "x", "w"), Labels.of("z", "y", "x", "w"),
@ -96,7 +96,7 @@ class LoggingMetricExporterTest {
true, true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
nowEpochNanos, nowEpochNanos,
nowEpochNanos + 245, nowEpochNanos + 245,
Labels.of("1", "2", "3", "4"), Labels.of("1", "2", "3", "4"),

View File

@ -25,7 +25,7 @@ import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.extension.otproto.MetricAdapter; import io.opentelemetry.sdk.extension.otproto.MetricAdapter;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -252,7 +252,8 @@ class OtlpGrpcMetricExporterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(startNs, endNs, Labels.of("k", "v"), 5)))); Collections.singletonList(
LongPointData.create(startNs, endNs, Labels.of("k", "v"), 5))));
} }
private static final class FakeCollector extends MetricsServiceGrpc.MetricsServiceImplBase { private static final class FakeCollector extends MetricsServiceGrpc.MetricsServiceImplBase {

View File

@ -9,14 +9,14 @@ import static io.prometheus.client.Collector.doubleToGoString;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.MetricDataType; import io.opentelemetry.sdk.metrics.data.MetricDataType;
import io.opentelemetry.sdk.metrics.data.Point; import io.opentelemetry.sdk.metrics.data.PointData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import io.prometheus.client.Collector; import io.prometheus.client.Collector;
import io.prometheus.client.Collector.MetricFamilySamples; import io.prometheus.client.Collector.MetricFamilySamples;
@ -93,13 +93,13 @@ final class MetricAdapter {
// Converts a list of points from MetricData to a list of Prometheus Samples. // Converts a list of points from MetricData to a list of Prometheus Samples.
static List<Sample> toSamples( static List<Sample> toSamples(
String name, MetricDataType type, Collection<? extends Point> points) { String name, MetricDataType type, Collection<? extends PointData> points) {
final List<Sample> samples = new ArrayList<>(estimateNumSamples(points.size(), type)); final List<Sample> samples = new ArrayList<>(estimateNumSamples(points.size(), type));
for (Point point : points) { for (PointData pointData : points) {
List<String> labelNames = Collections.emptyList(); List<String> labelNames = Collections.emptyList();
List<String> labelValues = Collections.emptyList(); List<String> labelValues = Collections.emptyList();
Labels labels = point.getLabels(); Labels labels = pointData.getLabels();
if (labels.size() != 0) { if (labels.size() != 0) {
labelNames = new ArrayList<>(labels.size()); labelNames = new ArrayList<>(labels.size());
labelValues = new ArrayList<>(labels.size()); labelValues = new ArrayList<>(labels.size());
@ -110,16 +110,17 @@ final class MetricAdapter {
switch (type) { switch (type) {
case DOUBLE_SUM: case DOUBLE_SUM:
case DOUBLE_GAUGE: case DOUBLE_GAUGE:
DoublePoint doublePoint = (DoublePoint) point; DoublePointData doublePoint = (DoublePointData) pointData;
samples.add(new Sample(name, labelNames, labelValues, doublePoint.getValue())); samples.add(new Sample(name, labelNames, labelValues, doublePoint.getValue()));
break; break;
case LONG_SUM: case LONG_SUM:
case LONG_GAUGE: case LONG_GAUGE:
LongPoint longPoint = (LongPoint) point; LongPointData longPoint = (LongPointData) pointData;
samples.add(new Sample(name, labelNames, labelValues, longPoint.getValue())); samples.add(new Sample(name, labelNames, labelValues, longPoint.getValue()));
break; break;
case SUMMARY: case SUMMARY:
addSummarySamples((DoubleSummaryPoint) point, name, labelNames, labelValues, samples); addSummarySamples(
(DoubleSummaryPointData) pointData, name, labelNames, labelValues, samples);
break; break;
} }
} }
@ -144,7 +145,7 @@ final class MetricAdapter {
} }
private static void addSummarySamples( private static void addSummarySamples(
DoubleSummaryPoint doubleSummaryPoint, DoubleSummaryPointData doubleSummaryPoint,
String name, String name,
List<String> labelNames, List<String> labelNames,
List<String> labelValues, List<String> labelValues,
@ -176,7 +177,7 @@ final class MetricAdapter {
return numPoints; return numPoints;
} }
private static Collection<? extends Point> getPoints(MetricData metricData) { private static Collection<? extends PointData> getPoints(MetricData metricData) {
switch (metricData.getType()) { switch (metricData.getType()) {
case DOUBLE_GAUGE: case DOUBLE_GAUGE:
return metricData.getDoubleGaugeData().getPoints(); return metricData.getDoubleGaugeData().getPoints();

View File

@ -14,12 +14,12 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.MetricDataType; import io.opentelemetry.sdk.metrics.data.MetricDataType;
@ -44,7 +44,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData NON_MONOTONIC_CUMULATIVE_DOUBLE_SUM = private static final MetricData NON_MONOTONIC_CUMULATIVE_DOUBLE_SUM =
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -55,7 +56,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData MONOTONIC_DELTA_DOUBLE_SUM = private static final MetricData MONOTONIC_DELTA_DOUBLE_SUM =
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -66,7 +68,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.DELTA, AggregationTemporality.DELTA,
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData NON_MONOTONIC_DELTA_DOUBLE_SUM = private static final MetricData NON_MONOTONIC_DELTA_DOUBLE_SUM =
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -77,7 +80,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.DELTA, AggregationTemporality.DELTA,
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData MONOTONIC_CUMULATIVE_LONG_SUM = private static final MetricData MONOTONIC_CUMULATIVE_LONG_SUM =
MetricData.createLongSum( MetricData.createLongSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -88,7 +92,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(LongPointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData NON_MONOTONIC_CUMULATIVE_LONG_SUM = private static final MetricData NON_MONOTONIC_CUMULATIVE_LONG_SUM =
MetricData.createLongSum( MetricData.createLongSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -99,7 +103,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(LongPointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData MONOTONIC_DELTA_LONG_SUM = private static final MetricData MONOTONIC_DELTA_LONG_SUM =
MetricData.createLongSum( MetricData.createLongSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -110,7 +114,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.DELTA, AggregationTemporality.DELTA,
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(LongPointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData NON_MONOTONIC_DELTA_LONG_SUM = private static final MetricData NON_MONOTONIC_DELTA_LONG_SUM =
MetricData.createLongSum( MetricData.createLongSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -121,7 +125,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.DELTA, AggregationTemporality.DELTA,
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(LongPointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData DOUBLE_GAUGE = private static final MetricData DOUBLE_GAUGE =
MetricData.createDoubleGauge( MetricData.createDoubleGauge(
@ -131,7 +135,8 @@ class MetricAdapterTest {
"description", "description",
"1", "1",
DoubleGaugeData.create( DoubleGaugeData.create(
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData LONG_GAUGE = private static final MetricData LONG_GAUGE =
MetricData.createLongGauge( MetricData.createLongGauge(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -140,7 +145,7 @@ class MetricAdapterTest {
"description", "description",
"1", "1",
LongGaugeData.create( LongGaugeData.create(
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))); Collections.singletonList(LongPointData.create(123, 456, Labels.of("kp", "vp"), 5))));
private static final MetricData SUMMARY = private static final MetricData SUMMARY =
MetricData.createDoubleSummary( MetricData.createDoubleSummary(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
@ -150,7 +155,7 @@ class MetricAdapterTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
123, 456, Labels.of("kp", "vp"), 5, 7, Collections.emptyList())))); 123, 456, Labels.of("kp", "vp"), 5, 7, Collections.emptyList()))));
@Test @Test
@ -212,8 +217,8 @@ class MetricAdapterTest {
"full_name", "full_name",
MetricDataType.LONG_SUM, MetricDataType.LONG_SUM,
ImmutableList.of( ImmutableList.of(
LongPoint.create(123, 456, Labels.empty(), 5), LongPointData.create(123, 456, Labels.empty(), 5),
LongPoint.create(321, 654, Labels.of("kp", "vp"), 7)))) LongPointData.create(321, 654, Labels.of("kp", "vp"), 7))))
.containsExactly( .containsExactly(
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5), new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7)); new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
@ -223,8 +228,8 @@ class MetricAdapterTest {
"full_name", "full_name",
MetricDataType.LONG_GAUGE, MetricDataType.LONG_GAUGE,
ImmutableList.of( ImmutableList.of(
LongPoint.create(123, 456, Labels.empty(), 5), LongPointData.create(123, 456, Labels.empty(), 5),
LongPoint.create(321, 654, Labels.of("kp", "vp"), 7)))) LongPointData.create(321, 654, Labels.of("kp", "vp"), 7))))
.containsExactly( .containsExactly(
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5), new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7)); new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
@ -241,7 +246,8 @@ class MetricAdapterTest {
MetricAdapter.toSamples( MetricAdapter.toSamples(
"full_name", "full_name",
MetricDataType.DOUBLE_SUM, MetricDataType.DOUBLE_SUM,
Collections.singletonList(DoublePoint.create(123, 456, Labels.of("kp", "vp"), 5)))) Collections.singletonList(
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 5))))
.containsExactly( .containsExactly(
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 5)); new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 5));
@ -250,8 +256,8 @@ class MetricAdapterTest {
"full_name", "full_name",
MetricDataType.DOUBLE_GAUGE, MetricDataType.DOUBLE_GAUGE,
ImmutableList.of( ImmutableList.of(
DoublePoint.create(123, 456, Labels.empty(), 5), DoublePointData.create(123, 456, Labels.empty(), 5),
DoublePoint.create(321, 654, Labels.of("kp", "vp"), 7)))) DoublePointData.create(321, 654, Labels.of("kp", "vp"), 7))))
.containsExactly( .containsExactly(
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5), new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7)); new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
@ -268,7 +274,7 @@ class MetricAdapterTest {
"full_name", "full_name",
MetricDataType.SUMMARY, MetricDataType.SUMMARY,
ImmutableList.of( ImmutableList.of(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
321, 321,
654, 654,
Labels.of("kp", "vp"), Labels.of("kp", "vp"),
@ -289,9 +295,9 @@ class MetricAdapterTest {
"full_name", "full_name",
MetricDataType.SUMMARY, MetricDataType.SUMMARY,
ImmutableList.of( ImmutableList.of(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()), 123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
321, 321,
654, 654,
Labels.of("kp", "vp"), Labels.of("kp", "vp"),

View File

@ -14,9 +14,9 @@ import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.export.MetricProducer; import io.opentelemetry.sdk.metrics.export.MetricProducer;
@ -69,7 +69,8 @@ class PrometheusCollectorTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(123, 456, Labels.of("kp", "vp"), 5)))), Collections.singletonList(
LongPointData.create(123, 456, Labels.of("kp", "vp"), 5)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.create(Attributes.of(stringKey("kr"), "vr")), Resource.create(Attributes.of(stringKey("kr"), "vr")),
InstrumentationLibraryInfo.create("http", "version"), InstrumentationLibraryInfo.create("http", "version"),
@ -80,6 +81,6 @@ class PrometheusCollectorTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(123, 456, Labels.of("kp", "vp"), 3.5))))); DoublePointData.create(123, 456, Labels.of("kp", "vp"), 3.5)))));
} }
} }

View File

@ -22,14 +22,15 @@ import io.opentelemetry.api.common.LabelsBuilder;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.PointData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.ArrayList; import java.util.ArrayList;
@ -93,7 +94,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
} }
} }
Labels labels = labelsBuilder.build(); Labels labels = labelsBuilder.build();
List<io.opentelemetry.sdk.metrics.data.Point> points = new ArrayList<>(); List<PointData> points = new ArrayList<>();
MetricDescriptor.Type type = null; MetricDescriptor.Type type = null;
for (Point point : timeSeries.getPoints()) { for (Point point : timeSeries.getPoints()) {
type = mapAndAddPoint(unsupportedTypes, metric, labels, points, point); type = mapAndAddPoint(unsupportedTypes, metric, labels, points, point);
@ -119,7 +120,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
Set<MetricDescriptor.Type> unsupportedTypes, Set<MetricDescriptor.Type> unsupportedTypes,
Metric metric, Metric metric,
Labels labels, Labels labels,
List<io.opentelemetry.sdk.metrics.data.Point> points, List<PointData> points,
Point point) { Point point) {
long timestampNanos = long timestampNanos =
TimeUnit.SECONDS.toNanos(point.getTimestamp().getSeconds()) TimeUnit.SECONDS.toNanos(point.getTimestamp().getSeconds())
@ -149,9 +150,9 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
} }
@Nonnull @Nonnull
private static DoubleSummaryPoint mapSummaryPoint( private static DoubleSummaryPointData mapSummaryPoint(
Labels labels, Point point, long timestampNanos) { Labels labels, Point point, long timestampNanos) {
return DoubleSummaryPoint.create( return DoubleSummaryPointData.create(
timestampNanos, timestampNanos,
timestampNanos, timestampNanos,
labels, labels,
@ -178,8 +179,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
} }
@Nonnull @Nonnull
private static DoublePoint mapDoublePoint(Labels labels, Point point, long timestampNanos) { private static DoublePointData mapDoublePoint(Labels labels, Point point, long timestampNanos) {
return DoublePoint.create( return DoublePointData.create(
timestampNanos, timestampNanos,
timestampNanos, timestampNanos,
labels, labels,
@ -189,8 +190,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
} }
@Nonnull @Nonnull
private static LongPoint mapLongPoint(Labels labels, Point point, long timestampNanos) { private static LongPointData mapLongPoint(Labels labels, Point point, long timestampNanos) {
return LongPoint.create( return LongPointData.create(
timestampNanos, timestampNanos,
timestampNanos, timestampNanos,
labels, labels,
@ -204,7 +205,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
private static MetricData toMetricData( private static MetricData toMetricData(
MetricDescriptor.Type type, MetricDescriptor.Type type,
MetricDescriptor metricDescriptor, MetricDescriptor metricDescriptor,
List<? extends io.opentelemetry.sdk.metrics.data.Point> points) { List<? extends PointData> points) {
if (metricDescriptor.getType() == null) { if (metricDescriptor.getType() == null) {
return null; return null;
} }
@ -216,7 +217,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
metricDescriptor.getName(), metricDescriptor.getName(),
metricDescriptor.getDescription(), metricDescriptor.getDescription(),
metricDescriptor.getUnit(), metricDescriptor.getUnit(),
LongGaugeData.create((List<LongPoint>) points)); LongGaugeData.create((List<LongPointData>) points));
case GAUGE_DOUBLE: case GAUGE_DOUBLE:
return MetricData.createDoubleGauge( return MetricData.createDoubleGauge(
@ -225,7 +226,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
metricDescriptor.getName(), metricDescriptor.getName(),
metricDescriptor.getDescription(), metricDescriptor.getDescription(),
metricDescriptor.getUnit(), metricDescriptor.getUnit(),
DoubleGaugeData.create((List<DoublePoint>) points)); DoubleGaugeData.create((List<DoublePointData>) points));
case CUMULATIVE_INT64: case CUMULATIVE_INT64:
return MetricData.createLongSum( return MetricData.createLongSum(
@ -234,7 +235,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
metricDescriptor.getName(), metricDescriptor.getName(),
metricDescriptor.getDescription(), metricDescriptor.getDescription(),
metricDescriptor.getUnit(), metricDescriptor.getUnit(),
LongSumData.create(true, AggregationTemporality.CUMULATIVE, (List<LongPoint>) points)); LongSumData.create(
true, AggregationTemporality.CUMULATIVE, (List<LongPointData>) points));
case CUMULATIVE_DOUBLE: case CUMULATIVE_DOUBLE:
return MetricData.createDoubleSum( return MetricData.createDoubleSum(
Resource.getDefault(), Resource.getDefault(),
@ -243,7 +245,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
metricDescriptor.getDescription(), metricDescriptor.getDescription(),
metricDescriptor.getUnit(), metricDescriptor.getUnit(),
DoubleSumData.create( DoubleSumData.create(
true, AggregationTemporality.CUMULATIVE, (List<DoublePoint>) points)); true, AggregationTemporality.CUMULATIVE, (List<DoublePointData>) points));
case SUMMARY: case SUMMARY:
return MetricData.createDoubleSummary( return MetricData.createDoubleSummary(
Resource.getDefault(), Resource.getDefault(),
@ -251,7 +253,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
metricDescriptor.getName(), metricDescriptor.getName(),
metricDescriptor.getDescription(), metricDescriptor.getDescription(),
metricDescriptor.getUnit(), metricDescriptor.getUnit(),
DoubleSummaryData.create((List<DoubleSummaryPoint>) points)); DoubleSummaryData.create((List<DoubleSummaryPointData>) points));
default: default:
return null; return null;
} }

View File

@ -26,11 +26,11 @@ import io.opencensus.tags.TagMetadata.TagTtl;
import io.opencensus.tags.TagValue; import io.opencensus.tags.TagValue;
import io.opencensus.tags.Tagger; import io.opencensus.tags.Tagger;
import io.opencensus.tags.Tags; import io.opencensus.tags.Tags;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.MetricDataType; import io.opentelemetry.sdk.metrics.data.MetricDataType;
import io.opentelemetry.sdk.metrics.data.Point; import io.opentelemetry.sdk.metrics.data.PointData;
import java.util.List; import java.util.List;
import org.junit.Test; import org.junit.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
@ -105,10 +105,10 @@ public class MetricInteroperabilityTest {
assertThat(metric.getUnit()).isEqualTo("ms"); assertThat(metric.getUnit()).isEqualTo("ms");
assertThat(metric.getType()).isEqualTo(MetricDataType.LONG_SUM); assertThat(metric.getType()).isEqualTo(MetricDataType.LONG_SUM);
assertThat(metric.getLongSumData().getPoints().size()).isEqualTo(1); assertThat(metric.getLongSumData().getPoints().size()).isEqualTo(1);
Point point = metric.getLongSumData().getPoints().iterator().next(); PointData pointData = metric.getLongSumData().getPoints().iterator().next();
assertThat(((LongPoint) point).getValue()).isEqualTo(50); assertThat(((LongPointData) pointData).getValue()).isEqualTo(50);
assertThat(point.getLabels().size()).isEqualTo(1); assertThat(pointData.getLabels().size()).isEqualTo(1);
assertThat(point.getLabels().get(tagKey.getName())).isEqualTo(tagValue.asString()); assertThat(pointData.getLabels().get(tagKey.getName())).isEqualTo(tagValue.asString());
metric = metricData.get(1); metric = metricData.get(1);
assertThat(metric.getName()).isEqualTo("long_gauge"); assertThat(metric.getName()).isEqualTo("long_gauge");
@ -123,9 +123,9 @@ public class MetricInteroperabilityTest {
assertThat(metric.getUnit()).isEqualTo("ms"); assertThat(metric.getUnit()).isEqualTo("ms");
assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_SUM); assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_SUM);
assertThat(metric.getDoubleSumData().getPoints().size()).isEqualTo(1); assertThat(metric.getDoubleSumData().getPoints().size()).isEqualTo(1);
point = metric.getDoubleSumData().getPoints().iterator().next(); pointData = metric.getDoubleSumData().getPoints().iterator().next();
assertThat(((DoublePoint) point).getValue()).isEqualTo(60); assertThat(((DoublePointData) pointData).getValue()).isEqualTo(60);
assertThat(point.getLabels().size()).isEqualTo(0); assertThat(pointData.getLabels().size()).isEqualTo(0);
metric = metricData.get(3); metric = metricData.get(3);
assertThat(metric.getName()).isEqualTo("double_gauge"); assertThat(metric.getName()).isEqualTo("double_gauge");
@ -133,9 +133,9 @@ public class MetricInteroperabilityTest {
assertThat(metric.getUnit()).isEqualTo("ms"); assertThat(metric.getUnit()).isEqualTo("ms");
assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_GAUGE); assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_GAUGE);
assertThat(metric.getDoubleGaugeData().getPoints().size()).isEqualTo(1); assertThat(metric.getDoubleGaugeData().getPoints().size()).isEqualTo(1);
point = metric.getDoubleGaugeData().getPoints().iterator().next(); pointData = metric.getDoubleGaugeData().getPoints().iterator().next();
assertThat(((DoublePoint) point).getValue()).isEqualTo(60); assertThat(((DoublePointData) pointData).getValue()).isEqualTo(60);
assertThat(point.getLabels().size()).isEqualTo(0); assertThat(pointData.getLabels().size()).isEqualTo(0);
} }
@Test @Test

View File

@ -19,9 +19,9 @@ import io.opentelemetry.context.Scope;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.OpenTelemetrySdk;
import io.opentelemetry.sdk.metrics.SdkMeterProvider; import io.opentelemetry.sdk.metrics.SdkMeterProvider;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.Point; import io.opentelemetry.sdk.metrics.data.PointData;
import io.opentelemetry.sdk.metrics.export.IntervalMetricReader; import io.opentelemetry.sdk.metrics.export.IntervalMetricReader;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.resources.ResourceAttributes; import io.opentelemetry.sdk.resources.ResourceAttributes;
@ -194,10 +194,10 @@ public class OtlpPipelineStressTest {
finishedMetricItems.stream().collect(Collectors.groupingBy(MetricData::getName)); finishedMetricItems.stream().collect(Collectors.groupingBy(MetricData::getName));
metricsByName.forEach( metricsByName.forEach(
(name, metricData) -> { (name, metricData) -> {
Stream<LongPoint> longPointStream = Stream<LongPointData> longPointStream =
metricData.stream().flatMap(md -> md.getLongSumData().getPoints().stream()); metricData.stream().flatMap(md -> md.getLongSumData().getPoints().stream());
Map<Labels, List<LongPoint>> pointsByLabelset = Map<Labels, List<LongPointData>> pointsByLabelset =
longPointStream.collect(Collectors.groupingBy(Point::getLabels)); longPointStream.collect(Collectors.groupingBy(PointData::getLabels));
pointsByLabelset.forEach( pointsByLabelset.forEach(
(labels, longPoints) -> { (labels, longPoints) -> {
long total = longPoints.get(longPoints.size() - 1).getValue(); long total = longPoints.get(longPoints.size() - 1).getValue();

View File

@ -25,12 +25,12 @@ import io.opentelemetry.proto.metrics.v1.Metric;
import io.opentelemetry.proto.metrics.v1.ResourceMetrics; import io.opentelemetry.proto.metrics.v1.ResourceMetrics;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
@ -164,9 +164,9 @@ public final class MetricAdapter {
return AGGREGATION_TEMPORALITY_UNSPECIFIED; return AGGREGATION_TEMPORALITY_UNSPECIFIED;
} }
static List<IntDataPoint> toIntDataPoints(Collection<LongPoint> points) { static List<IntDataPoint> toIntDataPoints(Collection<LongPointData> points) {
List<IntDataPoint> result = new ArrayList<>(points.size()); List<IntDataPoint> result = new ArrayList<>(points.size());
for (LongPoint longPoint : points) { for (LongPointData longPoint : points) {
IntDataPoint.Builder builder = IntDataPoint.Builder builder =
IntDataPoint.newBuilder() IntDataPoint.newBuilder()
.setStartTimeUnixNano(longPoint.getStartEpochNanos()) .setStartTimeUnixNano(longPoint.getStartEpochNanos())
@ -181,9 +181,9 @@ public final class MetricAdapter {
return result; return result;
} }
static Collection<DoubleDataPoint> toDoubleDataPoints(Collection<DoublePoint> points) { static Collection<DoubleDataPoint> toDoubleDataPoints(Collection<DoublePointData> points) {
List<DoubleDataPoint> result = new ArrayList<>(points.size()); List<DoubleDataPoint> result = new ArrayList<>(points.size());
for (DoublePoint doublePoint : points) { for (DoublePointData doublePoint : points) {
DoubleDataPoint.Builder builder = DoubleDataPoint.Builder builder =
DoubleDataPoint.newBuilder() DoubleDataPoint.newBuilder()
.setStartTimeUnixNano(doublePoint.getStartEpochNanos()) .setStartTimeUnixNano(doublePoint.getStartEpochNanos())
@ -198,9 +198,10 @@ public final class MetricAdapter {
return result; return result;
} }
static List<DoubleHistogramDataPoint> toSummaryDataPoints(Collection<DoubleSummaryPoint> points) { static List<DoubleHistogramDataPoint> toSummaryDataPoints(
Collection<DoubleSummaryPointData> points) {
List<DoubleHistogramDataPoint> result = new ArrayList<>(points.size()); List<DoubleHistogramDataPoint> result = new ArrayList<>(points.size());
for (DoubleSummaryPoint doubleSummaryPoint : points) { for (DoubleSummaryPointData doubleSummaryPoint : points) {
DoubleHistogramDataPoint.Builder builder = DoubleHistogramDataPoint.Builder builder =
DoubleHistogramDataPoint.newBuilder() DoubleHistogramDataPoint.newBuilder()
.setStartTimeUnixNano(doubleSummaryPoint.getStartEpochNanos()) .setStartTimeUnixNano(doubleSummaryPoint.getStartEpochNanos())

View File

@ -33,12 +33,12 @@ import io.opentelemetry.proto.metrics.v1.ResourceMetrics;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
@ -83,7 +83,7 @@ class MetricAdapterTest {
assertThat(MetricAdapter.toIntDataPoints(Collections.emptyList())).isEmpty(); assertThat(MetricAdapter.toIntDataPoints(Collections.emptyList())).isEmpty();
assertThat( assertThat(
MetricAdapter.toIntDataPoints( MetricAdapter.toIntDataPoints(
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5)))) singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))
.containsExactly( .containsExactly(
IntDataPoint.newBuilder() IntDataPoint.newBuilder()
.setStartTimeUnixNano(123) .setStartTimeUnixNano(123)
@ -95,8 +95,8 @@ class MetricAdapterTest {
assertThat( assertThat(
MetricAdapter.toIntDataPoints( MetricAdapter.toIntDataPoints(
ImmutableList.of( ImmutableList.of(
LongPoint.create(123, 456, Labels.empty(), 5), LongPointData.create(123, 456, Labels.empty(), 5),
LongPoint.create(321, 654, Labels.of("k", "v"), 7)))) LongPointData.create(321, 654, Labels.of("k", "v"), 7))))
.containsExactly( .containsExactly(
IntDataPoint.newBuilder() IntDataPoint.newBuilder()
.setStartTimeUnixNano(123) .setStartTimeUnixNano(123)
@ -117,7 +117,7 @@ class MetricAdapterTest {
assertThat(MetricAdapter.toDoubleDataPoints(Collections.emptyList())).isEmpty(); assertThat(MetricAdapter.toDoubleDataPoints(Collections.emptyList())).isEmpty();
assertThat( assertThat(
MetricAdapter.toDoubleDataPoints( MetricAdapter.toDoubleDataPoints(
singletonList(DoublePoint.create(123, 456, Labels.of("k", "v"), 5.1)))) singletonList(DoublePointData.create(123, 456, Labels.of("k", "v"), 5.1))))
.containsExactly( .containsExactly(
DoubleDataPoint.newBuilder() DoubleDataPoint.newBuilder()
.setStartTimeUnixNano(123) .setStartTimeUnixNano(123)
@ -129,8 +129,8 @@ class MetricAdapterTest {
assertThat( assertThat(
MetricAdapter.toDoubleDataPoints( MetricAdapter.toDoubleDataPoints(
ImmutableList.of( ImmutableList.of(
DoublePoint.create(123, 456, Labels.empty(), 5.1), DoublePointData.create(123, 456, Labels.empty(), 5.1),
DoublePoint.create(321, 654, Labels.of("k", "v"), 7.1)))) DoublePointData.create(321, 654, Labels.of("k", "v"), 7.1))))
.containsExactly( .containsExactly(
DoubleDataPoint.newBuilder() DoubleDataPoint.newBuilder()
.setStartTimeUnixNano(123) .setStartTimeUnixNano(123)
@ -151,7 +151,7 @@ class MetricAdapterTest {
assertThat( assertThat(
MetricAdapter.toSummaryDataPoints( MetricAdapter.toSummaryDataPoints(
singletonList( singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
123, 123,
456, 456,
Labels.of("k", "v"), Labels.of("k", "v"),
@ -173,9 +173,9 @@ class MetricAdapterTest {
assertThat( assertThat(
MetricAdapter.toSummaryDataPoints( MetricAdapter.toSummaryDataPoints(
ImmutableList.of( ImmutableList.of(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()), 123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
321, 321,
654, 654,
Labels.of("k", "v"), Labels.of("k", "v"),
@ -219,7 +219,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5)))))) singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -254,7 +254,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
singletonList(DoublePoint.create(123, 456, Labels.of("k", "v"), 5.1)))))) singletonList(
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.1))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -293,7 +294,7 @@ class MetricAdapterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5)))))) singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -328,7 +329,8 @@ class MetricAdapterTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
singletonList(DoublePoint.create(123, 456, Labels.of("k", "v"), 5.1)))))) singletonList(
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.1))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -365,7 +367,7 @@ class MetricAdapterTest {
"description", "description",
"1", "1",
LongGaugeData.create( LongGaugeData.create(
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5)))))) singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -396,7 +398,8 @@ class MetricAdapterTest {
"description", "description",
"1", "1",
DoubleGaugeData.create( DoubleGaugeData.create(
singletonList(DoublePoint.create(123, 456, Labels.of("k", "v"), 5.1)))))) singletonList(
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.1))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
.setName("name") .setName("name")
@ -432,7 +435,7 @@ class MetricAdapterTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
singletonList( singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
123, 456, Labels.of("k", "v"), 5, 33d, emptyList())))))) 123, 456, Labels.of("k", "v"), 5, 33d, emptyList()))))))
.isEqualTo( .isEqualTo(
Metric.newBuilder() Metric.newBuilder()
@ -513,7 +516,7 @@ class MetricAdapterTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))), DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
resource, resource,
instrumentationLibraryInfo, instrumentationLibraryInfo,
@ -524,7 +527,7 @@ class MetricAdapterTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))), DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.getEmpty(), Resource.getEmpty(),
instrumentationLibraryInfo, instrumentationLibraryInfo,
@ -535,7 +538,7 @@ class MetricAdapterTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))), DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
Resource.getEmpty(), Resource.getEmpty(),
InstrumentationLibraryInfo.getEmpty(), InstrumentationLibraryInfo.getEmpty(),
@ -546,7 +549,7 @@ class MetricAdapterTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0))))))) DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))))))
.containsExactlyInAnyOrder( .containsExactlyInAnyOrder(
ResourceMetrics.newBuilder() ResourceMetrics.newBuilder()
.setResource(resourceProto) .setResource(resourceProto)

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -61,7 +61,7 @@ final class CountAggregator implements Aggregator<Long> {
Map<Labels, Long> accumulationByLabels, Map<Labels, Long> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<LongPoint> points = List<LongPointData> points =
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
return MetricData.createLongSum( return MetricData.createLongSum(

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -65,7 +65,7 @@ final class DoubleLastValueAggregator implements Aggregator<Double> {
Map<Labels, Double> accumulationByLabels, Map<Labels, Double> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<DoublePoint> points = List<DoublePointData> points =
MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos);
switch (descriptor.getType()) { switch (descriptor.getType()) {

View File

@ -10,7 +10,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -62,7 +62,7 @@ final class DoubleMinMaxSumCountAggregator implements Aggregator<MinMaxSumCountA
Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels, Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<DoubleSummaryPoint> points = List<DoubleSummaryPointData> points =
MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos);
return MetricData.createDoubleSummary( return MetricData.createDoubleSummary(
resource, resource,

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -53,7 +53,7 @@ final class DoubleSumAggregator implements Aggregator<Double> {
Map<Labels, Double> accumulationByLabels, Map<Labels, Double> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<DoublePoint> points = List<DoublePointData> points =
MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos);
boolean isMonotonic = boolean isMonotonic =
descriptor.getType() == InstrumentType.COUNTER descriptor.getType() == InstrumentType.COUNTER

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -64,7 +64,7 @@ final class LongLastValueAggregator implements Aggregator<Long> {
Map<Labels, Long> accumulationByLabels, Map<Labels, Long> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<LongPoint> points = List<LongPointData> points =
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
switch (descriptor.getType()) { switch (descriptor.getType()) {

View File

@ -10,7 +10,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -61,7 +61,7 @@ final class LongMinMaxSumCountAggregator implements Aggregator<MinMaxSumCountAcc
Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels, Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<DoubleSummaryPoint> points = List<DoubleSummaryPointData> points =
MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos);
return MetricData.createDoubleSummary( return MetricData.createDoubleSummary(
resource, resource,

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.List; import java.util.List;
@ -53,7 +53,7 @@ final class LongSumAggregator implements Aggregator<Long> {
Map<Labels, Long> accumulationByLabels, Map<Labels, Long> accumulationByLabels,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<LongPoint> points = List<LongPointData> points =
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos); MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
boolean isMonotonic = boolean isMonotonic =
descriptor.getType() == InstrumentType.COUNTER descriptor.getType() == InstrumentType.COUNTER

View File

@ -9,10 +9,10 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor; import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -27,7 +27,7 @@ final class MetricDataUtils {
Resource resource, Resource resource,
InstrumentationLibraryInfo instrumentationLibraryInfo, InstrumentationLibraryInfo instrumentationLibraryInfo,
InstrumentDescriptor descriptor, InstrumentDescriptor descriptor,
List<LongPoint> points, List<LongPointData> points,
boolean isMonotonic) { boolean isMonotonic) {
return MetricData.createLongSum( return MetricData.createLongSum(
resource, resource,
@ -42,7 +42,7 @@ final class MetricDataUtils {
Resource resource, Resource resource,
InstrumentationLibraryInfo instrumentationLibraryInfo, InstrumentationLibraryInfo instrumentationLibraryInfo,
InstrumentDescriptor descriptor, InstrumentDescriptor descriptor,
List<DoublePoint> points, List<DoublePointData> points,
boolean isMonotonic) { boolean isMonotonic) {
return MetricData.createDoubleSum( return MetricData.createDoubleSum(
resource, resource,
@ -53,29 +53,29 @@ final class MetricDataUtils {
DoubleSumData.create(isMonotonic, AggregationTemporality.CUMULATIVE, points)); DoubleSumData.create(isMonotonic, AggregationTemporality.CUMULATIVE, points));
} }
static List<LongPoint> toLongPointList( static List<LongPointData> toLongPointList(
Map<Labels, Long> accumulationMap, long startEpochNanos, long epochNanos) { Map<Labels, Long> accumulationMap, long startEpochNanos, long epochNanos) {
List<LongPoint> points = new ArrayList<>(accumulationMap.size()); List<LongPointData> points = new ArrayList<>(accumulationMap.size());
accumulationMap.forEach( accumulationMap.forEach(
(labels, accumulation) -> (labels, accumulation) ->
points.add(LongPoint.create(startEpochNanos, epochNanos, labels, accumulation))); points.add(LongPointData.create(startEpochNanos, epochNanos, labels, accumulation)));
return points; return points;
} }
static List<DoublePoint> toDoublePointList( static List<DoublePointData> toDoublePointList(
Map<Labels, Double> accumulationMap, long startEpochNanos, long epochNanos) { Map<Labels, Double> accumulationMap, long startEpochNanos, long epochNanos) {
List<DoublePoint> points = new ArrayList<>(accumulationMap.size()); List<DoublePointData> points = new ArrayList<>(accumulationMap.size());
accumulationMap.forEach( accumulationMap.forEach(
(labels, accumulation) -> (labels, accumulation) ->
points.add(DoublePoint.create(startEpochNanos, epochNanos, labels, accumulation))); points.add(DoublePointData.create(startEpochNanos, epochNanos, labels, accumulation)));
return points; return points;
} }
static List<DoubleSummaryPoint> toDoubleSummaryPointList( static List<DoubleSummaryPointData> toDoubleSummaryPointList(
Map<Labels, MinMaxSumCountAccumulation> accumulationMap, Map<Labels, MinMaxSumCountAccumulation> accumulationMap,
long startEpochNanos, long startEpochNanos,
long epochNanos) { long epochNanos) {
List<DoubleSummaryPoint> points = new ArrayList<>(accumulationMap.size()); List<DoubleSummaryPointData> points = new ArrayList<>(accumulationMap.size());
accumulationMap.forEach( accumulationMap.forEach(
(labels, aggregator) -> (labels, aggregator) ->
points.add(aggregator.toPoint(startEpochNanos, epochNanos, labels))); points.add(aggregator.toPoint(startEpochNanos, epochNanos, labels)));

View File

@ -7,7 +7,7 @@ package io.opentelemetry.sdk.metrics.aggregator;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import java.util.Arrays; import java.util.Arrays;
import javax.annotation.concurrent.Immutable; import javax.annotation.concurrent.Immutable;
@ -58,8 +58,8 @@ abstract class MinMaxSumCountAccumulation {
*/ */
abstract double getMax(); abstract double getMax();
final DoubleSummaryPoint toPoint(long startEpochNanos, long epochNanos, Labels labels) { final DoubleSummaryPointData toPoint(long startEpochNanos, long epochNanos, Labels labels) {
return DoubleSummaryPoint.create( return DoubleSummaryPointData.create(
startEpochNanos, startEpochNanos,
epochNanos, epochNanos,
labels, labels,

View File

@ -9,11 +9,11 @@ import java.util.Collection;
import javax.annotation.concurrent.Immutable; import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
interface Data<T extends Point> { interface Data<T extends PointData> {
/** /**
* Returns the data {@link Point}s for this metric. * Returns the data {@link PointData}s for this metric.
* *
* @return the data {@link Point}s for this metric, or empty {@code Collection} if no points. * @return the data {@link PointData}s for this metric, or empty {@code Collection} if no points.
*/ */
Collection<T> getPoints(); Collection<T> getPoints();
} }

View File

@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class DoubleGaugeData implements Data<DoublePoint> { public abstract class DoubleGaugeData implements Data<DoublePointData> {
public static DoubleGaugeData create(Collection<DoublePoint> points) { public static DoubleGaugeData create(Collection<DoublePointData> points) {
return new AutoValue_DoubleGaugeData(points); return new AutoValue_DoubleGaugeData(points);
} }
DoubleGaugeData() {} DoubleGaugeData() {}
@Override @Override
public abstract Collection<DoublePoint> getPoints(); public abstract Collection<DoublePointData> getPoints();
} }

View File

@ -15,13 +15,13 @@ import javax.annotation.concurrent.Immutable;
*/ */
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class DoublePoint implements Point { public abstract class DoublePointData implements PointData {
public static DoublePoint create( public static DoublePointData create(
long startEpochNanos, long epochNanos, Labels labels, double value) { long startEpochNanos, long epochNanos, Labels labels, double value) {
return new AutoValue_DoublePoint(startEpochNanos, epochNanos, labels, value); return new AutoValue_DoublePointData(startEpochNanos, epochNanos, labels, value);
} }
DoublePoint() {} DoublePointData() {}
/** /**
* Returns the value of the data point. * Returns the value of the data point.

View File

@ -11,11 +11,11 @@ import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class DoubleSumData implements SumData<DoublePoint> { public abstract class DoubleSumData implements SumData<DoublePointData> {
DoubleSumData() {} DoubleSumData() {}
public static DoubleSumData create( public static DoubleSumData create(
boolean isMonotonic, AggregationTemporality temporality, Collection<DoublePoint> points) { boolean isMonotonic, AggregationTemporality temporality, Collection<DoublePointData> points) {
return new AutoValue_DoubleSumData(points, isMonotonic, temporality); return new AutoValue_DoubleSumData(points, isMonotonic, temporality);
} }
} }

View File

@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class DoubleSummaryData implements Data<DoubleSummaryPoint> { public abstract class DoubleSummaryData implements Data<DoubleSummaryPointData> {
DoubleSummaryData() {} DoubleSummaryData() {}
public static DoubleSummaryData create(Collection<DoubleSummaryPoint> points) { public static DoubleSummaryData create(Collection<DoubleSummaryPointData> points) {
return new AutoValue_DoubleSummaryData(points); return new AutoValue_DoubleSummaryData(points);
} }
@Override @Override
public abstract Collection<DoubleSummaryPoint> getPoints(); public abstract Collection<DoubleSummaryPointData> getPoints();
} }

View File

@ -16,19 +16,19 @@ import javax.annotation.concurrent.Immutable;
*/ */
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class DoubleSummaryPoint implements Point { public abstract class DoubleSummaryPointData implements PointData {
public static DoubleSummaryPoint create( public static DoubleSummaryPointData create(
long startEpochNanos, long startEpochNanos,
long epochNanos, long epochNanos,
Labels labels, Labels labels,
long count, long count,
double sum, double sum,
List<ValueAtPercentile> percentileValues) { List<ValueAtPercentile> percentileValues) {
return new AutoValue_DoubleSummaryPoint( return new AutoValue_DoubleSummaryPointData(
startEpochNanos, epochNanos, labels, count, sum, percentileValues); startEpochNanos, epochNanos, labels, count, sum, percentileValues);
} }
DoubleSummaryPoint() {} DoubleSummaryPointData() {}
/** /**
* The number of values that are being summarized. * The number of values that are being summarized.

View File

@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class LongGaugeData implements Data<LongPoint> { public abstract class LongGaugeData implements Data<LongPointData> {
public static LongGaugeData create(Collection<LongPoint> points) { public static LongGaugeData create(Collection<LongPointData> points) {
return new AutoValue_LongGaugeData(points); return new AutoValue_LongGaugeData(points);
} }
LongGaugeData() {} LongGaugeData() {}
@Override @Override
public abstract Collection<LongPoint> getPoints(); public abstract Collection<LongPointData> getPoints();
} }

View File

@ -17,9 +17,9 @@ import javax.annotation.concurrent.Immutable;
*/ */
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class LongPoint implements Point { public abstract class LongPointData implements PointData {
LongPoint() {} LongPointData() {}
/** /**
* Returns the value of the data point. * Returns the value of the data point.
@ -28,7 +28,8 @@ public abstract class LongPoint implements Point {
*/ */
public abstract long getValue(); public abstract long getValue();
public static LongPoint create(long startEpochNanos, long epochNanos, Labels labels, long value) { public static LongPointData create(
return new AutoValue_LongPoint(startEpochNanos, epochNanos, labels, value); long startEpochNanos, long epochNanos, Labels labels, long value) {
return new AutoValue_LongPointData(startEpochNanos, epochNanos, labels, value);
} }
} }

View File

@ -11,9 +11,9 @@ import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
@AutoValue @AutoValue
public abstract class LongSumData implements SumData<LongPoint> { public abstract class LongSumData implements SumData<LongPointData> {
public static LongSumData create( public static LongSumData create(
boolean isMonotonic, AggregationTemporality temporality, Collection<LongPoint> points) { boolean isMonotonic, AggregationTemporality temporality, Collection<LongPointData> points) {
return new AutoValue_LongSumData(points, isMonotonic, temporality); return new AutoValue_LongSumData(points, isMonotonic, temporality);
} }

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
import javax.annotation.concurrent.Immutable; import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
public interface Point { public interface PointData {
/** /**
* Returns the start epoch timestamp in nanos of this {@code Instrument}, usually the time when * Returns the start epoch timestamp in nanos of this {@code Instrument}, usually the time when
* the metric was created or an aggregation was enabled. * the metric was created or an aggregation was enabled.

View File

@ -8,7 +8,7 @@ package io.opentelemetry.sdk.metrics.data;
import javax.annotation.concurrent.Immutable; import javax.annotation.concurrent.Immutable;
@Immutable @Immutable
interface SumData<T extends Point> extends Data<T> { interface SumData<T extends PointData> extends Data<T> {
/** /**
* Returns "true" if the sum is monotonic. * Returns "true" if the sum is monotonic.
* *

View File

@ -15,11 +15,11 @@ import io.opentelemetry.api.metrics.BatchRecorder;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
@ -122,7 +122,8 @@ class BatchRecorderSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(testClock.now(), testClock.now(), labelSet, 24.2d))))); DoublePointData.create(
testClock.now(), testClock.now(), labelSet, 24.2d)))));
assertThat(longCounter.collectAll(testClock.now())) assertThat(longCounter.collectAll(testClock.now()))
.containsExactly( .containsExactly(
MetricData.createLongSum( MetricData.createLongSum(
@ -135,7 +136,7 @@ class BatchRecorderSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), labelSet, 12))))); LongPointData.create(testClock.now(), testClock.now(), labelSet, 12)))));
assertThat(doubleUpDownCounter.collectAll(testClock.now())) assertThat(doubleUpDownCounter.collectAll(testClock.now()))
.containsExactly( .containsExactly(
MetricData.createDoubleSum( MetricData.createDoubleSum(
@ -148,7 +149,8 @@ class BatchRecorderSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create(testClock.now(), testClock.now(), labelSet, -12.1d))))); DoublePointData.create(
testClock.now(), testClock.now(), labelSet, -12.1d)))));
assertThat(longUpDownCounter.collectAll(testClock.now())) assertThat(longUpDownCounter.collectAll(testClock.now()))
.containsExactly( .containsExactly(
MetricData.createLongSum( MetricData.createLongSum(
@ -161,7 +163,7 @@ class BatchRecorderSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), labelSet, -12))))); LongPointData.create(testClock.now(), testClock.now(), labelSet, -12)))));
if (shouldHaveDeltas) { if (shouldHaveDeltas) {
assertThat(doubleValueRecorder.collectAll(testClock.now())) assertThat(doubleValueRecorder.collectAll(testClock.now()))
@ -174,7 +176,7 @@ class BatchRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
labelSet, labelSet,
@ -198,7 +200,7 @@ class BatchRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
labelSet, labelSet,

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -87,7 +87,7 @@ class DoubleCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -120,9 +120,10 @@ class DoubleCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
startTime, testClock.now(), Labels.of("K", "V"), 555.9d), startTime, testClock.now(), Labels.of("K", "V"), 555.9d),
DoublePoint.create(startTime, testClock.now(), Labels.empty(), 33.5d))))); DoublePointData.create(
startTime, testClock.now(), Labels.empty(), 33.5d)))));
// Repeat to prove we keep previous values. // Repeat to prove we keep previous values.
testClock.advanceNanos(SECOND_NANOS); testClock.advanceNanos(SECOND_NANOS);
@ -140,9 +141,10 @@ class DoubleCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
startTime, testClock.now(), Labels.of("K", "V"), 777.9d), startTime, testClock.now(), Labels.of("K", "V"), 777.9d),
DoublePoint.create(startTime, testClock.now(), Labels.empty(), 44.5d))))); DoublePointData.create(
startTime, testClock.now(), Labels.empty(), 44.5d)))));
} finally { } finally {
bound.unbind(); bound.unbind();
} }
@ -193,7 +195,7 @@ class DoubleCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000))))); testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000)))));
} }
@ -231,22 +233,22 @@ class DoubleCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -74,7 +74,7 @@ class DoubleSumObserverSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -92,7 +92,7 @@ class DoubleSumObserverSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - 2 * SECOND_NANOS, testClock.now() - 2 * SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -90,7 +90,7 @@ class DoubleUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -124,9 +124,10 @@ class DoubleUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
startTime, testClock.now(), Labels.of("K", "V"), 555.9d), startTime, testClock.now(), Labels.of("K", "V"), 555.9d),
DoublePoint.create(startTime, testClock.now(), Labels.empty(), 33.5d))))); DoublePointData.create(
startTime, testClock.now(), Labels.empty(), 33.5d)))));
// Repeat to prove we keep previous values. // Repeat to prove we keep previous values.
testClock.advanceNanos(SECOND_NANOS); testClock.advanceNanos(SECOND_NANOS);
@ -145,9 +146,10 @@ class DoubleUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
startTime, testClock.now(), Labels.of("K", "V"), 777.9d), startTime, testClock.now(), Labels.of("K", "V"), 777.9d),
DoublePoint.create(startTime, testClock.now(), Labels.empty(), 44.5d))))); DoublePointData.create(
startTime, testClock.now(), Labels.empty(), 44.5d)))));
} finally { } finally {
bound.unbind(); bound.unbind();
} }
@ -185,7 +187,7 @@ class DoubleUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000))))); testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000)))));
} }
@ -225,22 +227,22 @@ class DoubleUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
40_000), 40_000),
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -72,7 +72,7 @@ class DoubleUpDownSumObserverSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -90,7 +90,7 @@ class DoubleUpDownSumObserverSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - 2 * SECOND_NANOS, testClock.now() - 2 * SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.Collections; import java.util.Collections;
@ -71,7 +71,7 @@ class DoubleValueObserverSdkTest {
"ms", "ms",
DoubleGaugeData.create( DoubleGaugeData.create(
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -87,7 +87,7 @@ class DoubleValueObserverSdkTest {
"ms", "ms",
DoubleGaugeData.create( DoubleGaugeData.create(
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -86,7 +86,7 @@ class DoubleValueRecorderSdkTest {
"ms", "ms",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -120,14 +120,14 @@ class DoubleValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime, startTime,
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
3, 3,
323.3d, 323.3d,
valueAtPercentiles(-121.5d, 321.5d)), valueAtPercentiles(-121.5d, 321.5d)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime, startTime,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -149,14 +149,14 @@ class DoubleValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime + SECOND_NANOS, startTime + SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
1, 1,
222.0d, 222.0d,
valueAtPercentiles(222.0, 222.0d)), valueAtPercentiles(222.0, 222.0d)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime + SECOND_NANOS, startTime + SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -198,7 +198,7 @@ class DoubleValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
@ -243,28 +243,28 @@ class DoubleValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
4_000, 4_000,
40_000d, 40_000d,
valueAtPercentiles(9.0, 11.0)), valueAtPercentiles(9.0, 11.0)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
4_000, 4_000,
40_000d, 40_000d,
valueAtPercentiles(9.0, 11.0)), valueAtPercentiles(9.0, 11.0)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
4_000, 4_000,
40_000d, 40_000d,
valueAtPercentiles(9.0, 11.0)), valueAtPercentiles(9.0, 11.0)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -85,7 +85,7 @@ class LongCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -118,8 +118,9 @@ class LongCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 555), LongPointData.create(
LongPoint.create(startTime, testClock.now(), Labels.empty(), 33))))); startTime, testClock.now(), Labels.of("K", "V"), 555),
LongPointData.create(startTime, testClock.now(), Labels.empty(), 33)))));
// Repeat to prove we keep previous values. // Repeat to prove we keep previous values.
testClock.advanceNanos(SECOND_NANOS); testClock.advanceNanos(SECOND_NANOS);
@ -137,8 +138,9 @@ class LongCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 777), LongPointData.create(
LongPoint.create(startTime, testClock.now(), Labels.empty(), 44))))); startTime, testClock.now(), Labels.of("K", "V"), 777),
LongPointData.create(startTime, testClock.now(), Labels.empty(), 44)))));
} finally { } finally {
bound.unbind(); bound.unbind();
} }
@ -189,7 +191,7 @@ class LongCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000))))); testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000)))));
} }
@ -227,22 +229,22 @@ class LongCounterSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -72,7 +72,7 @@ class LongSumObserverSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -90,7 +90,7 @@ class LongSumObserverSdkTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - 2 * SECOND_NANOS, testClock.now() - 2 * SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -87,7 +87,7 @@ class LongUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -121,8 +121,9 @@ class LongUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 555), LongPointData.create(
LongPoint.create(startTime, testClock.now(), Labels.empty(), 33))))); startTime, testClock.now(), Labels.of("K", "V"), 555),
LongPointData.create(startTime, testClock.now(), Labels.empty(), 33)))));
// Repeat to prove we keep previous values. // Repeat to prove we keep previous values.
testClock.advanceNanos(SECOND_NANOS); testClock.advanceNanos(SECOND_NANOS);
@ -140,8 +141,9 @@ class LongUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 777), LongPointData.create(
LongPoint.create(startTime, testClock.now(), Labels.empty(), 44))))); startTime, testClock.now(), Labels.of("K", "V"), 777),
LongPointData.create(startTime, testClock.now(), Labels.empty(), 44)))));
} finally { } finally {
bound.unbind(); bound.unbind();
} }
@ -179,7 +181,7 @@ class LongUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000))))); testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000)))));
} }
@ -219,22 +221,22 @@ class LongUpDownCounterSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Arrays.asList( Arrays.asList(
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
20_000), 20_000),
LongPoint.create( LongPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -72,7 +72,7 @@ class LongUpDownSumObserverSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -90,7 +90,7 @@ class LongUpDownSumObserverSdkTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - 2 * SECOND_NANOS, testClock.now() - 2 * SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.Collections; import java.util.Collections;
@ -69,7 +69,7 @@ class LongValueObserverSdkTest {
"1", "1",
LongGaugeData.create( LongGaugeData.create(
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),
@ -85,7 +85,7 @@ class LongValueObserverSdkTest {
"1", "1",
LongGaugeData.create( LongGaugeData.create(
Collections.singletonList( Collections.singletonList(
LongPoint.create( LongPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("k", "v"), Labels.of("k", "v"),

View File

@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater; import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -85,7 +85,7 @@ class LongValueRecorderSdkTest {
"By", "By",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now() - SECOND_NANOS, testClock.now() - SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -118,14 +118,14 @@ class LongValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime, startTime,
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
3, 3,
323, 323,
valueAtPercentiles(-121, 321)), valueAtPercentiles(-121, 321)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime, startTime,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -147,14 +147,14 @@ class LongValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime + SECOND_NANOS, startTime + SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
1, 1,
222, 222,
valueAtPercentiles(222, 222)), valueAtPercentiles(222, 222)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
startTime + SECOND_NANOS, startTime + SECOND_NANOS,
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -199,7 +199,7 @@ class LongValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of("K", "V"), Labels.of("K", "V"),
@ -245,28 +245,28 @@ class LongValueRecorderSdkTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Arrays.asList( Arrays.asList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[0], values[0]), Labels.of(keys[0], values[0]),
2_000, 2_000,
20_000, 20_000,
valueAtPercentiles(9, 11)), valueAtPercentiles(9, 11)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[1], values[1]), Labels.of(keys[1], values[1]),
2_000, 2_000,
20_000, 20_000,
valueAtPercentiles(9, 11)), valueAtPercentiles(9, 11)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[2], values[2]), Labels.of(keys[2], values[2]),
2_000, 2_000,
20_000, 20_000,
valueAtPercentiles(9, 11)), valueAtPercentiles(9, 11)),
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.of(keys[3], values[3]), Labels.of(keys[3], values[3]),

View File

@ -22,12 +22,12 @@ import io.opentelemetry.sdk.metrics.aggregator.AggregatorFactory;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryData; import io.opentelemetry.sdk.metrics.data.DoubleSummaryData;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
@ -84,7 +84,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -95,7 +96,7 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10.1)))), testClock.now(), testClock.now(), Labels.empty(), 10.1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
@ -107,7 +108,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), -10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), -10)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -118,7 +120,7 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.empty(), -10.1)))), testClock.now(), testClock.now(), Labels.empty(), -10.1)))),
MetricData.createDoubleSummary( MetricData.createDoubleSummary(
RESOURCE, RESOURCE,
@ -128,7 +130,7 @@ public class SdkMeterProviderTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -145,7 +147,7 @@ public class SdkMeterProviderTest {
"1", "1",
DoubleSummaryData.create( DoubleSummaryData.create(
Collections.singletonList( Collections.singletonList(
DoubleSummaryPoint.create( DoubleSummaryPointData.create(
testClock.now(), testClock.now(),
testClock.now(), testClock.now(),
Labels.empty(), Labels.empty(),
@ -191,7 +193,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -202,7 +205,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -213,7 +217,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -224,7 +229,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -235,7 +241,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -246,7 +253,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1))))); LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))));
} }
@Test @Test
@ -289,7 +297,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -300,7 +309,7 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10.1)))), testClock.now(), testClock.now(), Labels.empty(), 10.1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
@ -312,7 +321,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), -10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), -10)))),
MetricData.createDoubleSum( MetricData.createDoubleSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -323,7 +333,7 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ false, /* isMonotonic= */ false,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.empty(), -10.1)))), testClock.now(), testClock.now(), Labels.empty(), -10.1)))),
MetricData.createLongGauge( MetricData.createLongGauge(
RESOURCE, RESOURCE,
@ -333,7 +343,8 @@ public class SdkMeterProviderTest {
"1", "1",
LongGaugeData.create( LongGaugeData.create(
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10)))),
MetricData.createDoubleGauge( MetricData.createDoubleGauge(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -342,7 +353,7 @@ public class SdkMeterProviderTest {
"1", "1",
DoubleGaugeData.create( DoubleGaugeData.create(
Collections.singletonList( Collections.singletonList(
DoublePoint.create( DoublePointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10.1))))); testClock.now(), testClock.now(), Labels.empty(), 10.1)))));
} }
@ -390,7 +401,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -401,7 +413,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -412,7 +425,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -423,7 +437,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -434,7 +449,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))),
MetricData.createLongSum( MetricData.createLongSum(
RESOURCE, RESOURCE,
INSTRUMENTATION_LIBRARY_INFO, INSTRUMENTATION_LIBRARY_INFO,
@ -445,7 +461,8 @@ public class SdkMeterProviderTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1))))); LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 1)))));
} }
private static void registerViewForAllTypes( private static void registerViewForAllTypes(

View File

@ -14,7 +14,7 @@ import io.opentelemetry.sdk.common.Clock;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.internal.TestClock; import io.opentelemetry.sdk.internal.TestClock;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -96,7 +96,8 @@ class SdkMeterRegistryTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))), LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10)))),
MetricData.createLongSum( MetricData.createLongSum(
Resource.getEmpty(), Resource.getEmpty(),
sdkMeter2.getInstrumentationLibraryInfo(), sdkMeter2.getInstrumentationLibraryInfo(),
@ -107,7 +108,8 @@ class SdkMeterRegistryTest {
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList( Collections.singletonList(
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10))))); LongPointData.create(
testClock.now(), testClock.now(), Labels.empty(), 10)))));
} }
@Test @Test

View File

@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.common.InstrumentValueType; import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -80,6 +80,6 @@ class CountAggregatorTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 1))))); Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 1)))));
} }
} }

View File

@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.common.InstrumentValueType; import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
import io.opentelemetry.sdk.metrics.data.DoubleGaugeData; import io.opentelemetry.sdk.metrics.data.DoubleGaugeData;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.Collections; import java.util.Collections;
@ -81,6 +81,7 @@ class DoubleLastValueAggregatorTest {
"description", "description",
"unit", "unit",
DoubleGaugeData.create( DoubleGaugeData.create(
Collections.singletonList(DoublePoint.create(0, 100, Labels.empty(), 10))))); Collections.singletonList(
DoublePointData.create(0, 100, Labels.empty(), 10)))));
} }
} }

View File

@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.common.InstrumentValueType; import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.DoublePoint; import io.opentelemetry.sdk.metrics.data.DoublePointData;
import io.opentelemetry.sdk.metrics.data.DoubleSumData; import io.opentelemetry.sdk.metrics.data.DoubleSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -93,6 +93,7 @@ class DoubleSumAggregatorTest {
DoubleSumData.create( DoubleSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(DoublePoint.create(0, 100, Labels.empty(), 10))))); Collections.singletonList(
DoublePointData.create(0, 100, Labels.empty(), 10)))));
} }
} }

View File

@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.common.InstrumentValueType; import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
import io.opentelemetry.sdk.metrics.data.LongGaugeData; import io.opentelemetry.sdk.metrics.data.LongGaugeData;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
import java.util.Collections; import java.util.Collections;
@ -79,6 +79,6 @@ class LongLastValueAggregatorTest {
"description", "description",
"unit", "unit",
LongGaugeData.create( LongGaugeData.create(
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 10))))); Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 10)))));
} }
} }

View File

@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
import io.opentelemetry.sdk.metrics.common.InstrumentType; import io.opentelemetry.sdk.metrics.common.InstrumentType;
import io.opentelemetry.sdk.metrics.common.InstrumentValueType; import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -95,6 +95,6 @@ class LongSumAggregatorTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 10))))); Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 10)))));
} }
} }

View File

@ -8,7 +8,7 @@ package io.opentelemetry.sdk.metrics.aggregator;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint; import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile; import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -16,7 +16,7 @@ class MinMaxSumCountAccumulationTest {
@Test @Test
void toPoint() { void toPoint() {
MinMaxSumCountAccumulation accumulation = MinMaxSumCountAccumulation.create(12, 25, 1, 3); MinMaxSumCountAccumulation accumulation = MinMaxSumCountAccumulation.create(12, 25, 1, 3);
DoubleSummaryPoint point = getPoint(accumulation); DoubleSummaryPointData point = getPoint(accumulation);
assertThat(point.getCount()).isEqualTo(12); assertThat(point.getCount()).isEqualTo(12);
assertThat(point.getSum()).isEqualTo(25); assertThat(point.getSum()).isEqualTo(25);
assertThat(point.getPercentileValues()).hasSize(2); assertThat(point.getPercentileValues()).hasSize(2);
@ -24,14 +24,14 @@ class MinMaxSumCountAccumulationTest {
assertThat(point.getPercentileValues().get(1)).isEqualTo(ValueAtPercentile.create(100.0, 3)); assertThat(point.getPercentileValues().get(1)).isEqualTo(ValueAtPercentile.create(100.0, 3));
} }
private static DoubleSummaryPoint getPoint(MinMaxSumCountAccumulation accumulation) { private static DoubleSummaryPointData getPoint(MinMaxSumCountAccumulation accumulation) {
DoubleSummaryPoint point = accumulation.toPoint(12345, 12358, Labels.of("key", "value")); DoubleSummaryPointData point = accumulation.toPoint(12345, 12358, Labels.of("key", "value"));
assertThat(point).isNotNull(); assertThat(point).isNotNull();
assertThat(point.getStartEpochNanos()).isEqualTo(12345); assertThat(point.getStartEpochNanos()).isEqualTo(12345);
assertThat(point.getEpochNanos()).isEqualTo(12358); assertThat(point.getEpochNanos()).isEqualTo(12358);
assertThat(point.getLabels().size()).isEqualTo(1); assertThat(point.getLabels().size()).isEqualTo(1);
assertThat(point.getLabels().get("key")).isEqualTo("value"); assertThat(point.getLabels().get("key")).isEqualTo("value");
assertThat(point).isInstanceOf(DoubleSummaryPoint.class); assertThat(point).isInstanceOf(DoubleSummaryPointData.class);
return point; return point;
} }
} }

View File

@ -25,12 +25,13 @@ class MetricDataTest {
ValueAtPercentile.create(0.0, DOUBLE_VALUE); ValueAtPercentile.create(0.0, DOUBLE_VALUE);
private static final ValueAtPercentile MAXIMUM_VALUE = private static final ValueAtPercentile MAXIMUM_VALUE =
ValueAtPercentile.create(100.0, DOUBLE_VALUE); ValueAtPercentile.create(100.0, DOUBLE_VALUE);
private static final LongPoint LONG_POINT = private static final LongPointData LONG_POINT =
LongPoint.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), LONG_VALUE); LongPointData.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), LONG_VALUE);
private static final DoublePoint DOUBLE_POINT = private static final DoublePointData DOUBLE_POINT =
DoublePoint.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), DOUBLE_VALUE); DoublePointData.create(
private static final DoubleSummaryPoint SUMMARY_POINT = START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), DOUBLE_VALUE);
DoubleSummaryPoint.create( private static final DoubleSummaryPointData SUMMARY_POINT =
DoubleSummaryPointData.create(
START_EPOCH_NANOS, START_EPOCH_NANOS,
EPOCH_NANOS, EPOCH_NANOS,
Labels.of("key", "value"), Labels.of("key", "value"),

View File

@ -12,7 +12,7 @@ import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -37,8 +37,8 @@ import org.mockito.quality.Strictness;
@ExtendWith(MockitoExtension.class) @ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT) @MockitoSettings(strictness = Strictness.LENIENT)
class IntervalMetricReaderTest { class IntervalMetricReaderTest {
private static final List<LongPoint> LONG_POINT_LIST = private static final List<LongPointData> LONG_POINT_LIST =
Collections.singletonList(LongPoint.create(1000, 3000, Labels.empty(), 1234567)); Collections.singletonList(LongPointData.create(1000, 3000, Labels.empty(), 1234567));
private static final MetricData METRIC_DATA = private static final MetricData METRIC_DATA =
MetricData.createLongSum( MetricData.createLongSum(

View File

@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import io.opentelemetry.api.common.Labels; import io.opentelemetry.api.common.Labels;
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo; import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality; import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.LongSumData; import io.opentelemetry.sdk.metrics.data.LongSumData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.resources.Resource;
@ -37,7 +37,8 @@ class InMemoryMetricExporterTest {
LongSumData.create( LongSumData.create(
/* isMonotonic= */ true, /* isMonotonic= */ true,
AggregationTemporality.CUMULATIVE, AggregationTemporality.CUMULATIVE,
Collections.singletonList(LongPoint.create(startNs, endNs, Labels.of("k", "v"), 5)))); Collections.singletonList(
LongPointData.create(startNs, endNs, Labels.of("k", "v"), 5))));
} }
@Test @Test

View File

@ -9,7 +9,7 @@ import io.opentelemetry.api.metrics.GlobalMetricsProvider;
import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.metrics.SdkMeterProvider; import io.opentelemetry.sdk.metrics.SdkMeterProvider;
import io.opentelemetry.sdk.metrics.data.LongPoint; import io.opentelemetry.sdk.metrics.data.LongPointData;
import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.export.MetricProducer; import io.opentelemetry.sdk.metrics.export.MetricProducer;
import io.opentelemetry.sdk.trace.ReadableSpan; import io.opentelemetry.sdk.trace.ReadableSpan;
@ -115,8 +115,8 @@ public class BatchSpanProcessorDroppedSpansBenchmark {
if (metricData.isEmpty()) { if (metricData.isEmpty()) {
return 0; return 0;
} else { } else {
Collection<LongPoint> points = metricData.getLongSumData().getPoints(); Collection<LongPointData> points = metricData.getLongSumData().getPoints();
for (LongPoint point : points) { for (LongPointData point : points) {
if (labelValue.equals(point.getLabels().get("dropped"))) { if (labelValue.equals(point.getLabels().get("dropped"))) {
return point.getValue(); return point.getValue();
} }