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:
parent
6bee59e912
commit
cbcec6b359
|
|
@ -12,7 +12,7 @@ import io.opentelemetry.api.common.Attributes;
|
|||
import io.opentelemetry.api.common.Labels;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.export.MetricExporter;
|
||||
|
|
@ -39,7 +39,7 @@ class OtlpJsonLoggingMetricExporterTest {
|
|||
DoubleSumData.create(
|
||||
true,
|
||||
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 =
|
||||
MetricData.createDoubleSum(
|
||||
|
|
@ -51,7 +51,7 @@ class OtlpJsonLoggingMetricExporterTest {
|
|||
DoubleSumData.create(
|
||||
true,
|
||||
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
|
||||
LogCapturer logs = LogCapturer.create().captureForType(OtlpJsonLoggingMetricExporter.class);
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import io.opentelemetry.api.common.Attributes;
|
|||
import io.opentelemetry.api.common.Labels;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.DoubleSummaryData;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
|
||||
|
|
@ -62,7 +62,7 @@ class LoggingMetricExporterTest {
|
|||
"ms",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
nowEpochNanos,
|
||||
nowEpochNanos + 245,
|
||||
Labels.of("a", "b", "c", "d"),
|
||||
|
|
@ -81,7 +81,7 @@ class LoggingMetricExporterTest {
|
|||
true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
nowEpochNanos,
|
||||
nowEpochNanos + 245,
|
||||
Labels.of("z", "y", "x", "w"),
|
||||
|
|
@ -96,7 +96,7 @@ class LoggingMetricExporterTest {
|
|||
true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
nowEpochNanos,
|
||||
nowEpochNanos + 245,
|
||||
Labels.of("1", "2", "3", "4"),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import io.opentelemetry.sdk.common.CompletableResultCode;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.extension.otproto.MetricAdapter;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -252,7 +252,8 @@ class OtlpGrpcMetricExporterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import static io.prometheus.client.Collector.doubleToGoString;
|
|||
|
||||
import io.opentelemetry.api.common.Labels;
|
||||
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.DoubleSummaryPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
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.prometheus.client.Collector;
|
||||
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.
|
||||
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));
|
||||
|
||||
for (Point point : points) {
|
||||
for (PointData pointData : points) {
|
||||
List<String> labelNames = Collections.emptyList();
|
||||
List<String> labelValues = Collections.emptyList();
|
||||
Labels labels = point.getLabels();
|
||||
Labels labels = pointData.getLabels();
|
||||
if (labels.size() != 0) {
|
||||
labelNames = new ArrayList<>(labels.size());
|
||||
labelValues = new ArrayList<>(labels.size());
|
||||
|
|
@ -110,16 +110,17 @@ final class MetricAdapter {
|
|||
switch (type) {
|
||||
case DOUBLE_SUM:
|
||||
case DOUBLE_GAUGE:
|
||||
DoublePoint doublePoint = (DoublePoint) point;
|
||||
DoublePointData doublePoint = (DoublePointData) pointData;
|
||||
samples.add(new Sample(name, labelNames, labelValues, doublePoint.getValue()));
|
||||
break;
|
||||
case LONG_SUM:
|
||||
case LONG_GAUGE:
|
||||
LongPoint longPoint = (LongPoint) point;
|
||||
LongPointData longPoint = (LongPointData) pointData;
|
||||
samples.add(new Sample(name, labelNames, labelValues, longPoint.getValue()));
|
||||
break;
|
||||
case SUMMARY:
|
||||
addSummarySamples((DoubleSummaryPoint) point, name, labelNames, labelValues, samples);
|
||||
addSummarySamples(
|
||||
(DoubleSummaryPointData) pointData, name, labelNames, labelValues, samples);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -144,7 +145,7 @@ final class MetricAdapter {
|
|||
}
|
||||
|
||||
private static void addSummarySamples(
|
||||
DoubleSummaryPoint doubleSummaryPoint,
|
||||
DoubleSummaryPointData doubleSummaryPoint,
|
||||
String name,
|
||||
List<String> labelNames,
|
||||
List<String> labelValues,
|
||||
|
|
@ -176,7 +177,7 @@ final class MetricAdapter {
|
|||
return numPoints;
|
||||
}
|
||||
|
||||
private static Collection<? extends Point> getPoints(MetricData metricData) {
|
||||
private static Collection<? extends PointData> getPoints(MetricData metricData) {
|
||||
switch (metricData.getType()) {
|
||||
case DOUBLE_GAUGE:
|
||||
return metricData.getDoubleGaugeData().getPoints();
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
|
||||
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.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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricDataType;
|
||||
|
|
@ -44,7 +44,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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 =
|
||||
MetricData.createDoubleSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -55,7 +56,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
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 =
|
||||
MetricData.createDoubleSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -66,7 +68,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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 =
|
||||
MetricData.createDoubleSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -77,7 +80,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
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 =
|
||||
MetricData.createLongSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -88,7 +92,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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 =
|
||||
MetricData.createLongSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -99,7 +103,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
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 =
|
||||
MetricData.createLongSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -110,7 +114,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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 =
|
||||
MetricData.createLongSum(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -121,7 +125,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
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 =
|
||||
MetricData.createDoubleGauge(
|
||||
|
|
@ -131,7 +135,8 @@ class MetricAdapterTest {
|
|||
"description",
|
||||
"1",
|
||||
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 =
|
||||
MetricData.createLongGauge(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -140,7 +145,7 @@ class MetricAdapterTest {
|
|||
"description",
|
||||
"1",
|
||||
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 =
|
||||
MetricData.createDoubleSummary(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
|
|
@ -150,7 +155,7 @@ class MetricAdapterTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
123, 456, Labels.of("kp", "vp"), 5, 7, Collections.emptyList()))));
|
||||
|
||||
@Test
|
||||
|
|
@ -212,8 +217,8 @@ class MetricAdapterTest {
|
|||
"full_name",
|
||||
MetricDataType.LONG_SUM,
|
||||
ImmutableList.of(
|
||||
LongPoint.create(123, 456, Labels.empty(), 5),
|
||||
LongPoint.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
LongPointData.create(123, 456, Labels.empty(), 5),
|
||||
LongPointData.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
.containsExactly(
|
||||
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
|
||||
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
|
||||
|
|
@ -223,8 +228,8 @@ class MetricAdapterTest {
|
|||
"full_name",
|
||||
MetricDataType.LONG_GAUGE,
|
||||
ImmutableList.of(
|
||||
LongPoint.create(123, 456, Labels.empty(), 5),
|
||||
LongPoint.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
LongPointData.create(123, 456, Labels.empty(), 5),
|
||||
LongPointData.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
.containsExactly(
|
||||
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
|
||||
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
|
||||
|
|
@ -241,7 +246,8 @@ class MetricAdapterTest {
|
|||
MetricAdapter.toSamples(
|
||||
"full_name",
|
||||
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(
|
||||
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 5));
|
||||
|
||||
|
|
@ -250,8 +256,8 @@ class MetricAdapterTest {
|
|||
"full_name",
|
||||
MetricDataType.DOUBLE_GAUGE,
|
||||
ImmutableList.of(
|
||||
DoublePoint.create(123, 456, Labels.empty(), 5),
|
||||
DoublePoint.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
DoublePointData.create(123, 456, Labels.empty(), 5),
|
||||
DoublePointData.create(321, 654, Labels.of("kp", "vp"), 7))))
|
||||
.containsExactly(
|
||||
new Sample("full_name", Collections.emptyList(), Collections.emptyList(), 5),
|
||||
new Sample("full_name", ImmutableList.of("kp"), ImmutableList.of("vp"), 7));
|
||||
|
|
@ -268,7 +274,7 @@ class MetricAdapterTest {
|
|||
"full_name",
|
||||
MetricDataType.SUMMARY,
|
||||
ImmutableList.of(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
321,
|
||||
654,
|
||||
Labels.of("kp", "vp"),
|
||||
|
|
@ -289,9 +295,9 @@ class MetricAdapterTest {
|
|||
"full_name",
|
||||
MetricDataType.SUMMARY,
|
||||
ImmutableList.of(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
321,
|
||||
654,
|
||||
Labels.of("kp", "vp"),
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ import io.opentelemetry.api.common.Attributes;
|
|||
import io.opentelemetry.api.common.Labels;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.export.MetricProducer;
|
||||
|
|
@ -69,7 +69,8 @@ class PrometheusCollectorTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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(
|
||||
Resource.create(Attributes.of(stringKey("kr"), "vr")),
|
||||
InstrumentationLibraryInfo.create("http", "version"),
|
||||
|
|
@ -80,6 +81,6 @@ class PrometheusCollectorTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(123, 456, Labels.of("kp", "vp"), 3.5)))));
|
||||
DoublePointData.create(123, 456, Labels.of("kp", "vp"), 3.5)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,14 +22,15 @@ import io.opentelemetry.api.common.LabelsBuilder;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
|
||||
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.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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
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.resources.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -93,7 +94,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
}
|
||||
}
|
||||
Labels labels = labelsBuilder.build();
|
||||
List<io.opentelemetry.sdk.metrics.data.Point> points = new ArrayList<>();
|
||||
List<PointData> points = new ArrayList<>();
|
||||
MetricDescriptor.Type type = null;
|
||||
for (Point point : timeSeries.getPoints()) {
|
||||
type = mapAndAddPoint(unsupportedTypes, metric, labels, points, point);
|
||||
|
|
@ -119,7 +120,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
Set<MetricDescriptor.Type> unsupportedTypes,
|
||||
Metric metric,
|
||||
Labels labels,
|
||||
List<io.opentelemetry.sdk.metrics.data.Point> points,
|
||||
List<PointData> points,
|
||||
Point point) {
|
||||
long timestampNanos =
|
||||
TimeUnit.SECONDS.toNanos(point.getTimestamp().getSeconds())
|
||||
|
|
@ -149,9 +150,9 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
}
|
||||
|
||||
@Nonnull
|
||||
private static DoubleSummaryPoint mapSummaryPoint(
|
||||
private static DoubleSummaryPointData mapSummaryPoint(
|
||||
Labels labels, Point point, long timestampNanos) {
|
||||
return DoubleSummaryPoint.create(
|
||||
return DoubleSummaryPointData.create(
|
||||
timestampNanos,
|
||||
timestampNanos,
|
||||
labels,
|
||||
|
|
@ -178,8 +179,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
}
|
||||
|
||||
@Nonnull
|
||||
private static DoublePoint mapDoublePoint(Labels labels, Point point, long timestampNanos) {
|
||||
return DoublePoint.create(
|
||||
private static DoublePointData mapDoublePoint(Labels labels, Point point, long timestampNanos) {
|
||||
return DoublePointData.create(
|
||||
timestampNanos,
|
||||
timestampNanos,
|
||||
labels,
|
||||
|
|
@ -189,8 +190,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
}
|
||||
|
||||
@Nonnull
|
||||
private static LongPoint mapLongPoint(Labels labels, Point point, long timestampNanos) {
|
||||
return LongPoint.create(
|
||||
private static LongPointData mapLongPoint(Labels labels, Point point, long timestampNanos) {
|
||||
return LongPointData.create(
|
||||
timestampNanos,
|
||||
timestampNanos,
|
||||
labels,
|
||||
|
|
@ -204,7 +205,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
private static MetricData toMetricData(
|
||||
MetricDescriptor.Type type,
|
||||
MetricDescriptor metricDescriptor,
|
||||
List<? extends io.opentelemetry.sdk.metrics.data.Point> points) {
|
||||
List<? extends PointData> points) {
|
||||
if (metricDescriptor.getType() == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -216,7 +217,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
metricDescriptor.getName(),
|
||||
metricDescriptor.getDescription(),
|
||||
metricDescriptor.getUnit(),
|
||||
LongGaugeData.create((List<LongPoint>) points));
|
||||
LongGaugeData.create((List<LongPointData>) points));
|
||||
|
||||
case GAUGE_DOUBLE:
|
||||
return MetricData.createDoubleGauge(
|
||||
|
|
@ -225,7 +226,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
metricDescriptor.getName(),
|
||||
metricDescriptor.getDescription(),
|
||||
metricDescriptor.getUnit(),
|
||||
DoubleGaugeData.create((List<DoublePoint>) points));
|
||||
DoubleGaugeData.create((List<DoublePointData>) points));
|
||||
|
||||
case CUMULATIVE_INT64:
|
||||
return MetricData.createLongSum(
|
||||
|
|
@ -234,7 +235,8 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
metricDescriptor.getName(),
|
||||
metricDescriptor.getDescription(),
|
||||
metricDescriptor.getUnit(),
|
||||
LongSumData.create(true, AggregationTemporality.CUMULATIVE, (List<LongPoint>) points));
|
||||
LongSumData.create(
|
||||
true, AggregationTemporality.CUMULATIVE, (List<LongPointData>) points));
|
||||
case CUMULATIVE_DOUBLE:
|
||||
return MetricData.createDoubleSum(
|
||||
Resource.getDefault(),
|
||||
|
|
@ -243,7 +245,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
metricDescriptor.getDescription(),
|
||||
metricDescriptor.getUnit(),
|
||||
DoubleSumData.create(
|
||||
true, AggregationTemporality.CUMULATIVE, (List<DoublePoint>) points));
|
||||
true, AggregationTemporality.CUMULATIVE, (List<DoublePointData>) points));
|
||||
case SUMMARY:
|
||||
return MetricData.createDoubleSummary(
|
||||
Resource.getDefault(),
|
||||
|
|
@ -251,7 +253,7 @@ public class OpenTelemetryMetricsExporter extends MetricExporter {
|
|||
metricDescriptor.getName(),
|
||||
metricDescriptor.getDescription(),
|
||||
metricDescriptor.getUnit(),
|
||||
DoubleSummaryData.create((List<DoubleSummaryPoint>) points));
|
||||
DoubleSummaryData.create((List<DoubleSummaryPointData>) points));
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ import io.opencensus.tags.TagMetadata.TagTtl;
|
|||
import io.opencensus.tags.TagValue;
|
||||
import io.opencensus.tags.Tagger;
|
||||
import io.opencensus.tags.Tags;
|
||||
import io.opentelemetry.sdk.metrics.data.DoublePoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.DoublePointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
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 org.junit.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
|
@ -105,10 +105,10 @@ public class MetricInteroperabilityTest {
|
|||
assertThat(metric.getUnit()).isEqualTo("ms");
|
||||
assertThat(metric.getType()).isEqualTo(MetricDataType.LONG_SUM);
|
||||
assertThat(metric.getLongSumData().getPoints().size()).isEqualTo(1);
|
||||
Point point = metric.getLongSumData().getPoints().iterator().next();
|
||||
assertThat(((LongPoint) point).getValue()).isEqualTo(50);
|
||||
assertThat(point.getLabels().size()).isEqualTo(1);
|
||||
assertThat(point.getLabels().get(tagKey.getName())).isEqualTo(tagValue.asString());
|
||||
PointData pointData = metric.getLongSumData().getPoints().iterator().next();
|
||||
assertThat(((LongPointData) pointData).getValue()).isEqualTo(50);
|
||||
assertThat(pointData.getLabels().size()).isEqualTo(1);
|
||||
assertThat(pointData.getLabels().get(tagKey.getName())).isEqualTo(tagValue.asString());
|
||||
|
||||
metric = metricData.get(1);
|
||||
assertThat(metric.getName()).isEqualTo("long_gauge");
|
||||
|
|
@ -123,9 +123,9 @@ public class MetricInteroperabilityTest {
|
|||
assertThat(metric.getUnit()).isEqualTo("ms");
|
||||
assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_SUM);
|
||||
assertThat(metric.getDoubleSumData().getPoints().size()).isEqualTo(1);
|
||||
point = metric.getDoubleSumData().getPoints().iterator().next();
|
||||
assertThat(((DoublePoint) point).getValue()).isEqualTo(60);
|
||||
assertThat(point.getLabels().size()).isEqualTo(0);
|
||||
pointData = metric.getDoubleSumData().getPoints().iterator().next();
|
||||
assertThat(((DoublePointData) pointData).getValue()).isEqualTo(60);
|
||||
assertThat(pointData.getLabels().size()).isEqualTo(0);
|
||||
|
||||
metric = metricData.get(3);
|
||||
assertThat(metric.getName()).isEqualTo("double_gauge");
|
||||
|
|
@ -133,9 +133,9 @@ public class MetricInteroperabilityTest {
|
|||
assertThat(metric.getUnit()).isEqualTo("ms");
|
||||
assertThat(metric.getType()).isEqualTo(MetricDataType.DOUBLE_GAUGE);
|
||||
assertThat(metric.getDoubleGaugeData().getPoints().size()).isEqualTo(1);
|
||||
point = metric.getDoubleGaugeData().getPoints().iterator().next();
|
||||
assertThat(((DoublePoint) point).getValue()).isEqualTo(60);
|
||||
assertThat(point.getLabels().size()).isEqualTo(0);
|
||||
pointData = metric.getDoubleGaugeData().getPoints().iterator().next();
|
||||
assertThat(((DoublePointData) pointData).getValue()).isEqualTo(60);
|
||||
assertThat(pointData.getLabels().size()).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ import io.opentelemetry.context.Scope;
|
|||
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
|
||||
import io.opentelemetry.sdk.OpenTelemetrySdk;
|
||||
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.Point;
|
||||
import io.opentelemetry.sdk.metrics.data.PointData;
|
||||
import io.opentelemetry.sdk.metrics.export.IntervalMetricReader;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
import io.opentelemetry.sdk.resources.ResourceAttributes;
|
||||
|
|
@ -194,10 +194,10 @@ public class OtlpPipelineStressTest {
|
|||
finishedMetricItems.stream().collect(Collectors.groupingBy(MetricData::getName));
|
||||
metricsByName.forEach(
|
||||
(name, metricData) -> {
|
||||
Stream<LongPoint> longPointStream =
|
||||
Stream<LongPointData> longPointStream =
|
||||
metricData.stream().flatMap(md -> md.getLongSumData().getPoints().stream());
|
||||
Map<Labels, List<LongPoint>> pointsByLabelset =
|
||||
longPointStream.collect(Collectors.groupingBy(Point::getLabels));
|
||||
Map<Labels, List<LongPointData>> pointsByLabelset =
|
||||
longPointStream.collect(Collectors.groupingBy(PointData::getLabels));
|
||||
pointsByLabelset.forEach(
|
||||
(labels, longPoints) -> {
|
||||
long total = longPoints.get(longPoints.size() - 1).getValue();
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ import io.opentelemetry.proto.metrics.v1.Metric;
|
|||
import io.opentelemetry.proto.metrics.v1.ResourceMetrics;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
|
||||
|
|
@ -164,9 +164,9 @@ public final class MetricAdapter {
|
|||
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());
|
||||
for (LongPoint longPoint : points) {
|
||||
for (LongPointData longPoint : points) {
|
||||
IntDataPoint.Builder builder =
|
||||
IntDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(longPoint.getStartEpochNanos())
|
||||
|
|
@ -181,9 +181,9 @@ public final class MetricAdapter {
|
|||
return result;
|
||||
}
|
||||
|
||||
static Collection<DoubleDataPoint> toDoubleDataPoints(Collection<DoublePoint> points) {
|
||||
static Collection<DoubleDataPoint> toDoubleDataPoints(Collection<DoublePointData> points) {
|
||||
List<DoubleDataPoint> result = new ArrayList<>(points.size());
|
||||
for (DoublePoint doublePoint : points) {
|
||||
for (DoublePointData doublePoint : points) {
|
||||
DoubleDataPoint.Builder builder =
|
||||
DoubleDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(doublePoint.getStartEpochNanos())
|
||||
|
|
@ -198,9 +198,10 @@ public final class MetricAdapter {
|
|||
return result;
|
||||
}
|
||||
|
||||
static List<DoubleHistogramDataPoint> toSummaryDataPoints(Collection<DoubleSummaryPoint> points) {
|
||||
static List<DoubleHistogramDataPoint> toSummaryDataPoints(
|
||||
Collection<DoubleSummaryPointData> points) {
|
||||
List<DoubleHistogramDataPoint> result = new ArrayList<>(points.size());
|
||||
for (DoubleSummaryPoint doubleSummaryPoint : points) {
|
||||
for (DoubleSummaryPointData doubleSummaryPoint : points) {
|
||||
DoubleHistogramDataPoint.Builder builder =
|
||||
DoubleHistogramDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(doubleSummaryPoint.getStartEpochNanos())
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ import io.opentelemetry.proto.metrics.v1.ResourceMetrics;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
|
||||
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.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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
|
||||
|
|
@ -83,7 +83,7 @@ class MetricAdapterTest {
|
|||
assertThat(MetricAdapter.toIntDataPoints(Collections.emptyList())).isEmpty();
|
||||
assertThat(
|
||||
MetricAdapter.toIntDataPoints(
|
||||
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5))))
|
||||
singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))
|
||||
.containsExactly(
|
||||
IntDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(123)
|
||||
|
|
@ -95,8 +95,8 @@ class MetricAdapterTest {
|
|||
assertThat(
|
||||
MetricAdapter.toIntDataPoints(
|
||||
ImmutableList.of(
|
||||
LongPoint.create(123, 456, Labels.empty(), 5),
|
||||
LongPoint.create(321, 654, Labels.of("k", "v"), 7))))
|
||||
LongPointData.create(123, 456, Labels.empty(), 5),
|
||||
LongPointData.create(321, 654, Labels.of("k", "v"), 7))))
|
||||
.containsExactly(
|
||||
IntDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(123)
|
||||
|
|
@ -117,7 +117,7 @@ class MetricAdapterTest {
|
|||
assertThat(MetricAdapter.toDoubleDataPoints(Collections.emptyList())).isEmpty();
|
||||
assertThat(
|
||||
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(
|
||||
DoubleDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(123)
|
||||
|
|
@ -129,8 +129,8 @@ class MetricAdapterTest {
|
|||
assertThat(
|
||||
MetricAdapter.toDoubleDataPoints(
|
||||
ImmutableList.of(
|
||||
DoublePoint.create(123, 456, Labels.empty(), 5.1),
|
||||
DoublePoint.create(321, 654, Labels.of("k", "v"), 7.1))))
|
||||
DoublePointData.create(123, 456, Labels.empty(), 5.1),
|
||||
DoublePointData.create(321, 654, Labels.of("k", "v"), 7.1))))
|
||||
.containsExactly(
|
||||
DoubleDataPoint.newBuilder()
|
||||
.setStartTimeUnixNano(123)
|
||||
|
|
@ -151,7 +151,7 @@ class MetricAdapterTest {
|
|||
assertThat(
|
||||
MetricAdapter.toSummaryDataPoints(
|
||||
singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
123,
|
||||
456,
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -173,9 +173,9 @@ class MetricAdapterTest {
|
|||
assertThat(
|
||||
MetricAdapter.toSummaryDataPoints(
|
||||
ImmutableList.of(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
123, 456, Labels.empty(), 7, 15.3, Collections.emptyList()),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
321,
|
||||
654,
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -219,7 +219,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
.isEqualTo(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -254,7 +254,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -293,7 +294,7 @@ class MetricAdapterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
.isEqualTo(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -328,7 +329,8 @@ class MetricAdapterTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ false,
|
||||
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(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -365,7 +367,7 @@ class MetricAdapterTest {
|
|||
"description",
|
||||
"1",
|
||||
LongGaugeData.create(
|
||||
singletonList(LongPoint.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
singletonList(LongPointData.create(123, 456, Labels.of("k", "v"), 5))))))
|
||||
.isEqualTo(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -396,7 +398,8 @@ class MetricAdapterTest {
|
|||
"description",
|
||||
"1",
|
||||
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(
|
||||
Metric.newBuilder()
|
||||
.setName("name")
|
||||
|
|
@ -432,7 +435,7 @@ class MetricAdapterTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
123, 456, Labels.of("k", "v"), 5, 33d, emptyList()))))))
|
||||
.isEqualTo(
|
||||
Metric.newBuilder()
|
||||
|
|
@ -513,7 +516,7 @@ class MetricAdapterTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
MetricData.createDoubleSum(
|
||||
resource,
|
||||
instrumentationLibraryInfo,
|
||||
|
|
@ -524,7 +527,7 @@ class MetricAdapterTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
MetricData.createDoubleSum(
|
||||
Resource.getEmpty(),
|
||||
instrumentationLibraryInfo,
|
||||
|
|
@ -535,7 +538,7 @@ class MetricAdapterTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))),
|
||||
MetricData.createDoubleSum(
|
||||
Resource.getEmpty(),
|
||||
InstrumentationLibraryInfo.getEmpty(),
|
||||
|
|
@ -546,7 +549,7 @@ class MetricAdapterTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(123, 456, Labels.of("k", "v"), 5.0)))))))
|
||||
DoublePointData.create(123, 456, Labels.of("k", "v"), 5.0)))))))
|
||||
.containsExactlyInAnyOrder(
|
||||
ResourceMetrics.newBuilder()
|
||||
.setResource(resourceProto)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -61,7 +61,7 @@ final class CountAggregator implements Aggregator<Long> {
|
|||
Map<Labels, Long> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<LongPoint> points =
|
||||
List<LongPointData> points =
|
||||
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
|
||||
return MetricData.createLongSum(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -65,7 +65,7 @@ final class DoubleLastValueAggregator implements Aggregator<Double> {
|
|||
Map<Labels, Double> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<DoublePoint> points =
|
||||
List<DoublePointData> points =
|
||||
MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
|
||||
switch (descriptor.getType()) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -62,7 +62,7 @@ final class DoubleMinMaxSumCountAggregator implements Aggregator<MinMaxSumCountA
|
|||
Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<DoubleSummaryPoint> points =
|
||||
List<DoubleSummaryPointData> points =
|
||||
MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
return MetricData.createDoubleSummary(
|
||||
resource,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -53,7 +53,7 @@ final class DoubleSumAggregator implements Aggregator<Double> {
|
|||
Map<Labels, Double> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<DoublePoint> points =
|
||||
List<DoublePointData> points =
|
||||
MetricDataUtils.toDoublePointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
boolean isMonotonic =
|
||||
descriptor.getType() == InstrumentType.COUNTER
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -64,7 +64,7 @@ final class LongLastValueAggregator implements Aggregator<Long> {
|
|||
Map<Labels, Long> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<LongPoint> points =
|
||||
List<LongPointData> points =
|
||||
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
|
||||
switch (descriptor.getType()) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -61,7 +61,7 @@ final class LongMinMaxSumCountAggregator implements Aggregator<MinMaxSumCountAcc
|
|||
Map<Labels, MinMaxSumCountAccumulation> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<DoubleSummaryPoint> points =
|
||||
List<DoubleSummaryPointData> points =
|
||||
MetricDataUtils.toDoubleSummaryPointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
return MetricData.createDoubleSummary(
|
||||
resource,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.resources.Resource;
|
||||
import java.util.List;
|
||||
|
|
@ -53,7 +53,7 @@ final class LongSumAggregator implements Aggregator<Long> {
|
|||
Map<Labels, Long> accumulationByLabels,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<LongPoint> points =
|
||||
List<LongPointData> points =
|
||||
MetricDataUtils.toLongPointList(accumulationByLabels, startEpochNanos, epochNanos);
|
||||
boolean isMonotonic =
|
||||
descriptor.getType() == InstrumentType.COUNTER
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
||||
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.DoubleSummaryPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -27,7 +27,7 @@ final class MetricDataUtils {
|
|||
Resource resource,
|
||||
InstrumentationLibraryInfo instrumentationLibraryInfo,
|
||||
InstrumentDescriptor descriptor,
|
||||
List<LongPoint> points,
|
||||
List<LongPointData> points,
|
||||
boolean isMonotonic) {
|
||||
return MetricData.createLongSum(
|
||||
resource,
|
||||
|
|
@ -42,7 +42,7 @@ final class MetricDataUtils {
|
|||
Resource resource,
|
||||
InstrumentationLibraryInfo instrumentationLibraryInfo,
|
||||
InstrumentDescriptor descriptor,
|
||||
List<DoublePoint> points,
|
||||
List<DoublePointData> points,
|
||||
boolean isMonotonic) {
|
||||
return MetricData.createDoubleSum(
|
||||
resource,
|
||||
|
|
@ -53,29 +53,29 @@ final class MetricDataUtils {
|
|||
DoubleSumData.create(isMonotonic, AggregationTemporality.CUMULATIVE, points));
|
||||
}
|
||||
|
||||
static List<LongPoint> toLongPointList(
|
||||
static List<LongPointData> toLongPointList(
|
||||
Map<Labels, Long> accumulationMap, long startEpochNanos, long epochNanos) {
|
||||
List<LongPoint> points = new ArrayList<>(accumulationMap.size());
|
||||
List<LongPointData> points = new ArrayList<>(accumulationMap.size());
|
||||
accumulationMap.forEach(
|
||||
(labels, accumulation) ->
|
||||
points.add(LongPoint.create(startEpochNanos, epochNanos, labels, accumulation)));
|
||||
points.add(LongPointData.create(startEpochNanos, epochNanos, labels, accumulation)));
|
||||
return points;
|
||||
}
|
||||
|
||||
static List<DoublePoint> toDoublePointList(
|
||||
static List<DoublePointData> toDoublePointList(
|
||||
Map<Labels, Double> accumulationMap, long startEpochNanos, long epochNanos) {
|
||||
List<DoublePoint> points = new ArrayList<>(accumulationMap.size());
|
||||
List<DoublePointData> points = new ArrayList<>(accumulationMap.size());
|
||||
accumulationMap.forEach(
|
||||
(labels, accumulation) ->
|
||||
points.add(DoublePoint.create(startEpochNanos, epochNanos, labels, accumulation)));
|
||||
points.add(DoublePointData.create(startEpochNanos, epochNanos, labels, accumulation)));
|
||||
return points;
|
||||
}
|
||||
|
||||
static List<DoubleSummaryPoint> toDoubleSummaryPointList(
|
||||
static List<DoubleSummaryPointData> toDoubleSummaryPointList(
|
||||
Map<Labels, MinMaxSumCountAccumulation> accumulationMap,
|
||||
long startEpochNanos,
|
||||
long epochNanos) {
|
||||
List<DoubleSummaryPoint> points = new ArrayList<>(accumulationMap.size());
|
||||
List<DoubleSummaryPointData> points = new ArrayList<>(accumulationMap.size());
|
||||
accumulationMap.forEach(
|
||||
(labels, aggregator) ->
|
||||
points.add(aggregator.toPoint(startEpochNanos, epochNanos, labels)));
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ package io.opentelemetry.sdk.metrics.aggregator;
|
|||
|
||||
import com.google.auto.value.AutoValue;
|
||||
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 java.util.Arrays;
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
|
@ -58,8 +58,8 @@ abstract class MinMaxSumCountAccumulation {
|
|||
*/
|
||||
abstract double getMax();
|
||||
|
||||
final DoubleSummaryPoint toPoint(long startEpochNanos, long epochNanos, Labels labels) {
|
||||
return DoubleSummaryPoint.create(
|
||||
final DoubleSummaryPointData toPoint(long startEpochNanos, long epochNanos, Labels labels) {
|
||||
return DoubleSummaryPointData.create(
|
||||
startEpochNanos,
|
||||
epochNanos,
|
||||
labels,
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ import java.util.Collection;
|
|||
import javax.annotation.concurrent.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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
|
|||
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class DoubleGaugeData implements Data<DoublePoint> {
|
||||
public static DoubleGaugeData create(Collection<DoublePoint> points) {
|
||||
public abstract class DoubleGaugeData implements Data<DoublePointData> {
|
||||
public static DoubleGaugeData create(Collection<DoublePointData> points) {
|
||||
return new AutoValue_DoubleGaugeData(points);
|
||||
}
|
||||
|
||||
DoubleGaugeData() {}
|
||||
|
||||
@Override
|
||||
public abstract Collection<DoublePoint> getPoints();
|
||||
public abstract Collection<DoublePointData> getPoints();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ import javax.annotation.concurrent.Immutable;
|
|||
*/
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class DoublePoint implements Point {
|
||||
public static DoublePoint create(
|
||||
public abstract class DoublePointData implements PointData {
|
||||
public static DoublePointData create(
|
||||
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.
|
||||
|
|
@ -11,11 +11,11 @@ import javax.annotation.concurrent.Immutable;
|
|||
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class DoubleSumData implements SumData<DoublePoint> {
|
||||
public abstract class DoubleSumData implements SumData<DoublePointData> {
|
||||
DoubleSumData() {}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
|
|||
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class DoubleSummaryData implements Data<DoubleSummaryPoint> {
|
||||
public abstract class DoubleSummaryData implements Data<DoubleSummaryPointData> {
|
||||
DoubleSummaryData() {}
|
||||
|
||||
public static DoubleSummaryData create(Collection<DoubleSummaryPoint> points) {
|
||||
public static DoubleSummaryData create(Collection<DoubleSummaryPointData> points) {
|
||||
return new AutoValue_DoubleSummaryData(points);
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract Collection<DoubleSummaryPoint> getPoints();
|
||||
public abstract Collection<DoubleSummaryPointData> getPoints();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,19 +16,19 @@ import javax.annotation.concurrent.Immutable;
|
|||
*/
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class DoubleSummaryPoint implements Point {
|
||||
public static DoubleSummaryPoint create(
|
||||
public abstract class DoubleSummaryPointData implements PointData {
|
||||
public static DoubleSummaryPointData create(
|
||||
long startEpochNanos,
|
||||
long epochNanos,
|
||||
Labels labels,
|
||||
long count,
|
||||
double sum,
|
||||
List<ValueAtPercentile> percentileValues) {
|
||||
return new AutoValue_DoubleSummaryPoint(
|
||||
return new AutoValue_DoubleSummaryPointData(
|
||||
startEpochNanos, epochNanos, labels, count, sum, percentileValues);
|
||||
}
|
||||
|
||||
DoubleSummaryPoint() {}
|
||||
DoubleSummaryPointData() {}
|
||||
|
||||
/**
|
||||
* The number of values that are being summarized.
|
||||
|
|
@ -11,13 +11,13 @@ import javax.annotation.concurrent.Immutable;
|
|||
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class LongGaugeData implements Data<LongPoint> {
|
||||
public static LongGaugeData create(Collection<LongPoint> points) {
|
||||
public abstract class LongGaugeData implements Data<LongPointData> {
|
||||
public static LongGaugeData create(Collection<LongPointData> points) {
|
||||
return new AutoValue_LongGaugeData(points);
|
||||
}
|
||||
|
||||
LongGaugeData() {}
|
||||
|
||||
@Override
|
||||
public abstract Collection<LongPoint> getPoints();
|
||||
public abstract Collection<LongPointData> getPoints();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ import javax.annotation.concurrent.Immutable;
|
|||
*/
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class LongPoint implements Point {
|
||||
public abstract class LongPointData implements PointData {
|
||||
|
||||
LongPoint() {}
|
||||
LongPointData() {}
|
||||
|
||||
/**
|
||||
* Returns the value of the data point.
|
||||
|
|
@ -28,7 +28,8 @@ public abstract class LongPoint implements Point {
|
|||
*/
|
||||
public abstract long getValue();
|
||||
|
||||
public static LongPoint create(long startEpochNanos, long epochNanos, Labels labels, long value) {
|
||||
return new AutoValue_LongPoint(startEpochNanos, epochNanos, labels, value);
|
||||
public static LongPointData create(
|
||||
long startEpochNanos, long epochNanos, Labels labels, long value) {
|
||||
return new AutoValue_LongPointData(startEpochNanos, epochNanos, labels, value);
|
||||
}
|
||||
}
|
||||
|
|
@ -11,9 +11,9 @@ import javax.annotation.concurrent.Immutable;
|
|||
|
||||
@Immutable
|
||||
@AutoValue
|
||||
public abstract class LongSumData implements SumData<LongPoint> {
|
||||
public abstract class LongSumData implements SumData<LongPointData> {
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
public interface Point {
|
||||
public interface PointData {
|
||||
/**
|
||||
* Returns the start epoch timestamp in nanos of this {@code Instrument}, usually the time when
|
||||
* the metric was created or an aggregation was enabled.
|
||||
|
|
@ -8,7 +8,7 @@ package io.opentelemetry.sdk.metrics.data;
|
|||
import javax.annotation.concurrent.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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ import io.opentelemetry.api.metrics.BatchRecorder;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.DoubleSummaryData;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.DoubleSummaryPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
|
||||
|
|
@ -122,7 +122,8 @@ class BatchRecorderSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
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()))
|
||||
.containsExactly(
|
||||
MetricData.createLongSum(
|
||||
|
|
@ -135,7 +136,7 @@ class BatchRecorderSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), labelSet, 12)))));
|
||||
LongPointData.create(testClock.now(), testClock.now(), labelSet, 12)))));
|
||||
assertThat(doubleUpDownCounter.collectAll(testClock.now()))
|
||||
.containsExactly(
|
||||
MetricData.createDoubleSum(
|
||||
|
|
@ -148,7 +149,8 @@ class BatchRecorderSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
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()))
|
||||
.containsExactly(
|
||||
MetricData.createLongSum(
|
||||
|
|
@ -161,7 +163,7 @@ class BatchRecorderSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), labelSet, -12)))));
|
||||
LongPointData.create(testClock.now(), testClock.now(), labelSet, -12)))));
|
||||
|
||||
if (shouldHaveDeltas) {
|
||||
assertThat(doubleValueRecorder.collectAll(testClock.now()))
|
||||
|
|
@ -174,7 +176,7 @@ class BatchRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
labelSet,
|
||||
|
|
@ -198,7 +200,7 @@ class BatchRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
labelSet,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -87,7 +87,7 @@ class DoubleCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -120,9 +120,10 @@ class DoubleCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
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.
|
||||
testClock.advanceNanos(SECOND_NANOS);
|
||||
|
|
@ -140,9 +141,10 @@ class DoubleCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
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 {
|
||||
bound.unbind();
|
||||
}
|
||||
|
|
@ -193,7 +195,7 @@ class DoubleCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000)))));
|
||||
}
|
||||
|
||||
|
|
@ -231,22 +233,22 @@ class DoubleCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -74,7 +74,7 @@ class DoubleSumObserverSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -92,7 +92,7 @@ class DoubleSumObserverSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - 2 * SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -90,7 +90,7 @@ class DoubleUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -124,9 +124,10 @@ class DoubleUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
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.
|
||||
testClock.advanceNanos(SECOND_NANOS);
|
||||
|
|
@ -145,9 +146,10 @@ class DoubleUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
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 {
|
||||
bound.unbind();
|
||||
}
|
||||
|
|
@ -185,7 +187,7 @@ class DoubleUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.of("K", "V"), 80_000)))));
|
||||
}
|
||||
|
||||
|
|
@ -225,22 +227,22 @@ class DoubleUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
40_000),
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -72,7 +72,7 @@ class DoubleUpDownSumObserverSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -90,7 +90,7 @@ class DoubleUpDownSumObserverSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - 2 * SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.resources.Resource;
|
||||
import java.util.Collections;
|
||||
|
|
@ -71,7 +71,7 @@ class DoubleValueObserverSdkTest {
|
|||
"ms",
|
||||
DoubleGaugeData.create(
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -87,7 +87,7 @@ class DoubleValueObserverSdkTest {
|
|||
"ms",
|
||||
DoubleGaugeData.create(
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.ValueAtPercentile;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -86,7 +86,7 @@ class DoubleValueRecorderSdkTest {
|
|||
"ms",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -120,14 +120,14 @@ class DoubleValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime,
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
3,
|
||||
323.3d,
|
||||
valueAtPercentiles(-121.5d, 321.5d)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -149,14 +149,14 @@ class DoubleValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime + SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
1,
|
||||
222.0d,
|
||||
valueAtPercentiles(222.0, 222.0d)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime + SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -198,7 +198,7 @@ class DoubleValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
|
|
@ -243,28 +243,28 @@ class DoubleValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
4_000,
|
||||
40_000d,
|
||||
valueAtPercentiles(9.0, 11.0)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
4_000,
|
||||
40_000d,
|
||||
valueAtPercentiles(9.0, 11.0)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
4_000,
|
||||
40_000d,
|
||||
valueAtPercentiles(9.0, 11.0)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -85,7 +85,7 @@ class LongCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -118,8 +118,9 @@ class LongCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 555),
|
||||
LongPoint.create(startTime, testClock.now(), Labels.empty(), 33)))));
|
||||
LongPointData.create(
|
||||
startTime, testClock.now(), Labels.of("K", "V"), 555),
|
||||
LongPointData.create(startTime, testClock.now(), Labels.empty(), 33)))));
|
||||
|
||||
// Repeat to prove we keep previous values.
|
||||
testClock.advanceNanos(SECOND_NANOS);
|
||||
|
|
@ -137,8 +138,9 @@ class LongCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 777),
|
||||
LongPoint.create(startTime, testClock.now(), Labels.empty(), 44)))));
|
||||
LongPointData.create(
|
||||
startTime, testClock.now(), Labels.of("K", "V"), 777),
|
||||
LongPointData.create(startTime, testClock.now(), Labels.empty(), 44)))));
|
||||
} finally {
|
||||
bound.unbind();
|
||||
}
|
||||
|
|
@ -189,7 +191,7 @@ class LongCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000)))));
|
||||
}
|
||||
|
||||
|
|
@ -227,22 +229,22 @@ class LongCounterSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -72,7 +72,7 @@ class LongSumObserverSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -90,7 +90,7 @@ class LongSumObserverSdkTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - 2 * SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -87,7 +87,7 @@ class LongUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -121,8 +121,9 @@ class LongUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 555),
|
||||
LongPoint.create(startTime, testClock.now(), Labels.empty(), 33)))));
|
||||
LongPointData.create(
|
||||
startTime, testClock.now(), Labels.of("K", "V"), 555),
|
||||
LongPointData.create(startTime, testClock.now(), Labels.empty(), 33)))));
|
||||
|
||||
// Repeat to prove we keep previous values.
|
||||
testClock.advanceNanos(SECOND_NANOS);
|
||||
|
|
@ -140,8 +141,9 @@ class LongUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(startTime, testClock.now(), Labels.of("K", "V"), 777),
|
||||
LongPoint.create(startTime, testClock.now(), Labels.empty(), 44)))));
|
||||
LongPointData.create(
|
||||
startTime, testClock.now(), Labels.of("K", "V"), 777),
|
||||
LongPointData.create(startTime, testClock.now(), Labels.empty(), 44)))));
|
||||
} finally {
|
||||
bound.unbind();
|
||||
}
|
||||
|
|
@ -179,7 +181,7 @@ class LongUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.of("K", "V"), 160_000)))));
|
||||
}
|
||||
|
||||
|
|
@ -219,22 +221,22 @@ class LongUpDownCounterSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Arrays.asList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
20_000),
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -72,7 +72,7 @@ class LongUpDownSumObserverSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -90,7 +90,7 @@ class LongUpDownSumObserverSdkTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - 2 * SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.resources.Resource;
|
||||
import java.util.Collections;
|
||||
|
|
@ -69,7 +69,7 @@ class LongValueObserverSdkTest {
|
|||
"1",
|
||||
LongGaugeData.create(
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
@ -85,7 +85,7 @@ class LongValueObserverSdkTest {
|
|||
"1",
|
||||
LongGaugeData.create(
|
||||
Collections.singletonList(
|
||||
LongPoint.create(
|
||||
LongPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("k", "v"),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
|||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
import io.opentelemetry.sdk.metrics.StressTestRunner.OperationUpdater;
|
||||
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.ValueAtPercentile;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -85,7 +85,7 @@ class LongValueRecorderSdkTest {
|
|||
"By",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now() - SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -118,14 +118,14 @@ class LongValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime,
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
3,
|
||||
323,
|
||||
valueAtPercentiles(-121, 321)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -147,14 +147,14 @@ class LongValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime + SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
1,
|
||||
222,
|
||||
valueAtPercentiles(222, 222)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
startTime + SECOND_NANOS,
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -199,7 +199,7 @@ class LongValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of("K", "V"),
|
||||
|
|
@ -245,28 +245,28 @@ class LongValueRecorderSdkTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Arrays.asList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[0], values[0]),
|
||||
2_000,
|
||||
20_000,
|
||||
valueAtPercentiles(9, 11)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[1], values[1]),
|
||||
2_000,
|
||||
20_000,
|
||||
valueAtPercentiles(9, 11)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[2], values[2]),
|
||||
2_000,
|
||||
20_000,
|
||||
valueAtPercentiles(9, 11)),
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.of(keys[3], values[3]),
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@ import io.opentelemetry.sdk.metrics.aggregator.AggregatorFactory;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
|
||||
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.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.LongPoint;
|
||||
import io.opentelemetry.sdk.metrics.data.LongPointData;
|
||||
import io.opentelemetry.sdk.metrics.data.LongSumData;
|
||||
import io.opentelemetry.sdk.metrics.data.MetricData;
|
||||
import io.opentelemetry.sdk.metrics.data.ValueAtPercentile;
|
||||
|
|
@ -84,7 +84,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
MetricData.createDoubleSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -95,7 +96,7 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10.1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
|
|
@ -107,7 +108,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), -10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), -10)))),
|
||||
MetricData.createDoubleSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -118,7 +120,7 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), -10.1)))),
|
||||
MetricData.createDoubleSummary(
|
||||
RESOURCE,
|
||||
|
|
@ -128,7 +130,7 @@ public class SdkMeterProviderTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -145,7 +147,7 @@ public class SdkMeterProviderTest {
|
|||
"1",
|
||||
DoubleSummaryData.create(
|
||||
Collections.singletonList(
|
||||
DoubleSummaryPoint.create(
|
||||
DoubleSummaryPointData.create(
|
||||
testClock.now(),
|
||||
testClock.now(),
|
||||
Labels.empty(),
|
||||
|
|
@ -191,7 +193,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -202,7 +205,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -213,7 +217,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -224,7 +229,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -235,7 +241,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -246,7 +253,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))));
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -289,7 +297,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
MetricData.createDoubleSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -300,7 +309,7 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10.1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
|
|
@ -312,7 +321,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), -10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), -10)))),
|
||||
MetricData.createDoubleSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -323,7 +333,7 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ false,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), -10.1)))),
|
||||
MetricData.createLongGauge(
|
||||
RESOURCE,
|
||||
|
|
@ -333,7 +343,8 @@ public class SdkMeterProviderTest {
|
|||
"1",
|
||||
LongGaugeData.create(
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
MetricData.createDoubleGauge(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -342,7 +353,7 @@ public class SdkMeterProviderTest {
|
|||
"1",
|
||||
DoubleGaugeData.create(
|
||||
Collections.singletonList(
|
||||
DoublePoint.create(
|
||||
DoublePointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10.1)))));
|
||||
}
|
||||
|
||||
|
|
@ -390,7 +401,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -401,7 +413,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -412,7 +425,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -423,7 +437,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -434,7 +449,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))),
|
||||
MetricData.createLongSum(
|
||||
RESOURCE,
|
||||
INSTRUMENTATION_LIBRARY_INFO,
|
||||
|
|
@ -445,7 +461,8 @@ public class SdkMeterProviderTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 1)))));
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 1)))));
|
||||
}
|
||||
|
||||
private static void registerViewForAllTypes(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import io.opentelemetry.sdk.common.Clock;
|
|||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
import io.opentelemetry.sdk.internal.TestClock;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -96,7 +96,8 @@ class SdkMeterRegistryTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10)))),
|
||||
MetricData.createLongSum(
|
||||
Resource.getEmpty(),
|
||||
sdkMeter2.getInstrumentationLibraryInfo(),
|
||||
|
|
@ -107,7 +108,8 @@ class SdkMeterRegistryTest {
|
|||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(
|
||||
LongPoint.create(testClock.now(), testClock.now(), Labels.empty(), 10)))));
|
||||
LongPointData.create(
|
||||
testClock.now(), testClock.now(), Labels.empty(), 10)))));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -80,6 +80,6 @@ class CountAggregatorTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 1)))));
|
||||
Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 1)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
|
||||
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.resources.Resource;
|
||||
import java.util.Collections;
|
||||
|
|
@ -81,6 +81,7 @@ class DoubleLastValueAggregatorTest {
|
|||
"description",
|
||||
"unit",
|
||||
DoubleGaugeData.create(
|
||||
Collections.singletonList(DoublePoint.create(0, 100, Labels.empty(), 10)))));
|
||||
Collections.singletonList(
|
||||
DoublePointData.create(0, 100, Labels.empty(), 10)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -93,6 +93,7 @@ class DoubleSumAggregatorTest {
|
|||
DoubleSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(DoublePoint.create(0, 100, Labels.empty(), 10)))));
|
||||
Collections.singletonList(
|
||||
DoublePointData.create(0, 100, Labels.empty(), 10)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
|
||||
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.resources.Resource;
|
||||
import java.util.Collections;
|
||||
|
|
@ -79,6 +79,6 @@ class LongLastValueAggregatorTest {
|
|||
"description",
|
||||
"unit",
|
||||
LongGaugeData.create(
|
||||
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 10)))));
|
||||
Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 10)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.opentelemetry.sdk.metrics.common.InstrumentDescriptor;
|
|||
import io.opentelemetry.sdk.metrics.common.InstrumentType;
|
||||
import io.opentelemetry.sdk.metrics.common.InstrumentValueType;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -95,6 +95,6 @@ class LongSumAggregatorTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
AggregationTemporality.CUMULATIVE,
|
||||
Collections.singletonList(LongPoint.create(0, 100, Labels.empty(), 10)))));
|
||||
Collections.singletonList(LongPointData.create(0, 100, Labels.empty(), 10)))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package io.opentelemetry.sdk.metrics.aggregator;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
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 org.junit.jupiter.api.Test;
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class MinMaxSumCountAccumulationTest {
|
|||
@Test
|
||||
void toPoint() {
|
||||
MinMaxSumCountAccumulation accumulation = MinMaxSumCountAccumulation.create(12, 25, 1, 3);
|
||||
DoubleSummaryPoint point = getPoint(accumulation);
|
||||
DoubleSummaryPointData point = getPoint(accumulation);
|
||||
assertThat(point.getCount()).isEqualTo(12);
|
||||
assertThat(point.getSum()).isEqualTo(25);
|
||||
assertThat(point.getPercentileValues()).hasSize(2);
|
||||
|
|
@ -24,14 +24,14 @@ class MinMaxSumCountAccumulationTest {
|
|||
assertThat(point.getPercentileValues().get(1)).isEqualTo(ValueAtPercentile.create(100.0, 3));
|
||||
}
|
||||
|
||||
private static DoubleSummaryPoint getPoint(MinMaxSumCountAccumulation accumulation) {
|
||||
DoubleSummaryPoint point = accumulation.toPoint(12345, 12358, Labels.of("key", "value"));
|
||||
private static DoubleSummaryPointData getPoint(MinMaxSumCountAccumulation accumulation) {
|
||||
DoubleSummaryPointData point = accumulation.toPoint(12345, 12358, Labels.of("key", "value"));
|
||||
assertThat(point).isNotNull();
|
||||
assertThat(point.getStartEpochNanos()).isEqualTo(12345);
|
||||
assertThat(point.getEpochNanos()).isEqualTo(12358);
|
||||
assertThat(point.getLabels().size()).isEqualTo(1);
|
||||
assertThat(point.getLabels().get("key")).isEqualTo("value");
|
||||
assertThat(point).isInstanceOf(DoubleSummaryPoint.class);
|
||||
assertThat(point).isInstanceOf(DoubleSummaryPointData.class);
|
||||
return point;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,12 +25,13 @@ class MetricDataTest {
|
|||
ValueAtPercentile.create(0.0, DOUBLE_VALUE);
|
||||
private static final ValueAtPercentile MAXIMUM_VALUE =
|
||||
ValueAtPercentile.create(100.0, DOUBLE_VALUE);
|
||||
private static final LongPoint LONG_POINT =
|
||||
LongPoint.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), LONG_VALUE);
|
||||
private static final DoublePoint DOUBLE_POINT =
|
||||
DoublePoint.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), DOUBLE_VALUE);
|
||||
private static final DoubleSummaryPoint SUMMARY_POINT =
|
||||
DoubleSummaryPoint.create(
|
||||
private static final LongPointData LONG_POINT =
|
||||
LongPointData.create(START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), LONG_VALUE);
|
||||
private static final DoublePointData DOUBLE_POINT =
|
||||
DoublePointData.create(
|
||||
START_EPOCH_NANOS, EPOCH_NANOS, Labels.of("key", "value"), DOUBLE_VALUE);
|
||||
private static final DoubleSummaryPointData SUMMARY_POINT =
|
||||
DoubleSummaryPointData.create(
|
||||
START_EPOCH_NANOS,
|
||||
EPOCH_NANOS,
|
||||
Labels.of("key", "value"),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import io.opentelemetry.api.common.Labels;
|
|||
import io.opentelemetry.sdk.common.CompletableResultCode;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -37,8 +37,8 @@ import org.mockito.quality.Strictness;
|
|||
@ExtendWith(MockitoExtension.class)
|
||||
@MockitoSettings(strictness = Strictness.LENIENT)
|
||||
class IntervalMetricReaderTest {
|
||||
private static final List<LongPoint> LONG_POINT_LIST =
|
||||
Collections.singletonList(LongPoint.create(1000, 3000, Labels.empty(), 1234567));
|
||||
private static final List<LongPointData> LONG_POINT_LIST =
|
||||
Collections.singletonList(LongPointData.create(1000, 3000, Labels.empty(), 1234567));
|
||||
|
||||
private static final MetricData METRIC_DATA =
|
||||
MetricData.createLongSum(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
import io.opentelemetry.api.common.Labels;
|
||||
import io.opentelemetry.sdk.common.InstrumentationLibraryInfo;
|
||||
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.MetricData;
|
||||
import io.opentelemetry.sdk.resources.Resource;
|
||||
|
|
@ -37,7 +37,8 @@ class InMemoryMetricExporterTest {
|
|||
LongSumData.create(
|
||||
/* isMonotonic= */ true,
|
||||
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
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import io.opentelemetry.api.metrics.GlobalMetricsProvider;
|
|||
import io.opentelemetry.api.trace.Tracer;
|
||||
import io.opentelemetry.sdk.common.CompletableResultCode;
|
||||
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.export.MetricProducer;
|
||||
import io.opentelemetry.sdk.trace.ReadableSpan;
|
||||
|
|
@ -115,8 +115,8 @@ public class BatchSpanProcessorDroppedSpansBenchmark {
|
|||
if (metricData.isEmpty()) {
|
||||
return 0;
|
||||
} else {
|
||||
Collection<LongPoint> points = metricData.getLongSumData().getPoints();
|
||||
for (LongPoint point : points) {
|
||||
Collection<LongPointData> points = metricData.getLongSumData().getPoints();
|
||||
for (LongPointData point : points) {
|
||||
if (labelValue.equals(point.getLabels().get("dropped"))) {
|
||||
return point.getValue();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue