Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge :sdk:metrics-testing into :sdk:testing #5144

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/apidiffs/current_vs_latest/opentelemetry-sdk-testing.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
Comparing source compatibility of against
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramAssert (not serializable)
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
+++ NEW METHOD: PUBLIC(+) FINAL(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramAssert hasPointsSatisfying(java.util.function.Consumer[])
+++ NEW ANNOTATION: java.lang.SafeVarargs
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramAssert hasPointsSatisfying(java.lang.Iterable)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramAssert isCumulative()
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramAssert isDelta()
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramBucketsAssert (not serializable)
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramBucketsAssert hasCounts(java.util.List)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramBucketsAssert hasOffset(int)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramBucketsAssert hasTotalCount(long)
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert (not serializable)
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
+++ NEW SUPERCLASS: io.opentelemetry.sdk.testing.assertj.AbstractPointAssert
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasCount(long)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasExemplars(io.opentelemetry.sdk.metrics.data.DoubleExemplarData[])
+++ NEW METHOD: PUBLIC(+) FINAL(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasExemplarsSatisfying(java.util.function.Consumer[])
+++ NEW ANNOTATION: java.lang.SafeVarargs
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasExemplarsSatisfying(java.lang.Iterable)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasMax(double)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasMin(double)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasNegativeBucketsSatisfying(java.util.function.Consumer)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasPositiveBucketsSatisfying(java.util.function.Consumer)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasScale(int)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasSum(double)
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.ExponentialHistogramPointAssert hasZeroCount(long)
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.testing.assertj.MetricAssert (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.testing.assertj.MetricAssert hasExponentialHistogramSatisfying(java.util.function.Consumer)
*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.testing.assertj.TracesAssert (not serializable)
=== CLASS FILE FORMAT VERSION: 52.0 <- 52.0
+++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.testing.assertj.TracesAssert assertThat(java.util.List)
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
import io.opentelemetry.proto.metrics.v1.SummaryDataPoint;
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
import io.opentelemetry.sdk.metrics.data.AggregationTemporality;
import io.opentelemetry.sdk.metrics.data.ExponentialHistogramBuckets;
import io.opentelemetry.sdk.metrics.data.ExponentialHistogramPointData;
import io.opentelemetry.sdk.metrics.data.HistogramPointData;
import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.metrics.data.PointData;
import io.opentelemetry.sdk.metrics.data.SummaryPointData;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableDoubleExemplarData;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableDoublePointData;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableExponentialHistogramBuckets;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableExponentialHistogramData;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableExponentialHistogramPointData;
import io.opentelemetry.sdk.metrics.internal.data.ImmutableGaugeData;
Expand Down Expand Up @@ -422,8 +422,8 @@ void exponentialHistogramDataPoints() {
1,
null,
null,
new TestExponentialHistogramBuckets(0, 0, Collections.emptyList()),
new TestExponentialHistogramBuckets(0, 0, Collections.emptyList()),
ImmutableExponentialHistogramBuckets.create(0, 0, Collections.emptyList()),
ImmutableExponentialHistogramBuckets.create(0, 0, Collections.emptyList()),
123,
456,
Attributes.empty(),
Expand All @@ -434,8 +434,9 @@ void exponentialHistogramDataPoints() {
1,
3.3,
80.1,
new TestExponentialHistogramBuckets(0, 1, ImmutableList.of(1L, 0L, 2L)),
new TestExponentialHistogramBuckets(0, 0, Collections.emptyList()),
ImmutableExponentialHistogramBuckets.create(
0, 1, ImmutableList.of(1L, 0L, 2L)),
ImmutableExponentialHistogramBuckets.create(0, 0, Collections.emptyList()),
123,
456,
Attributes.of(stringKey("key"), "value"),
Expand Down Expand Up @@ -837,9 +838,9 @@ void toProtoMetric_exponentialHistogram() {
257,
20.1,
44.3,
new TestExponentialHistogramBuckets(
ImmutableExponentialHistogramBuckets.create(
20, -1, ImmutableList.of(0L, 128L, 1L << 32)),
new TestExponentialHistogramBuckets(
ImmutableExponentialHistogramBuckets.create(
20, 1, ImmutableList.of(0L, 128L, 1L << 32)),
123,
456,
Expand Down Expand Up @@ -1149,41 +1150,4 @@ private static String toJson(Marshaler marshaler) {
}
return new String(bos.toByteArray(), StandardCharsets.UTF_8);
}

/**
* Helper class for creating Exponential Histogram bucket data directly without needing to record.
* Essentially, mocking out the bucket operations and downscaling.
*/
private static class TestExponentialHistogramBuckets implements ExponentialHistogramBuckets {

private final int scale;
private final int offset;
private final List<Long> bucketCounts;

TestExponentialHistogramBuckets(int scale, int offset, List<Long> bucketCounts) {
this.scale = scale;
this.offset = offset;
this.bucketCounts = bucketCounts;
}

@Override
public int getScale() {
return scale;
}

@Override
public int getOffset() {
return offset;
}

@Override
public List<Long> getBucketCounts() {
return bucketCounts;
}

@Override
public long getTotalCount() {
return getBucketCounts().stream().reduce(0L, Long::sum);
}
}
}
6 changes: 0 additions & 6 deletions sdk/metrics-testing/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions sdk/metrics-testing/build.gradle.kts

This file was deleted.

1 change: 0 additions & 1 deletion sdk/metrics-testing/gradle.properties

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading