Skip to content

Commit df09034

Browse files
committed
remove unused code
1 parent a670561 commit df09034

File tree

2 files changed

+0
-150
lines changed

2 files changed

+0
-150
lines changed

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/MetricAssertions.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package io.opentelemetry.contrib.jmxscraper.target_systems;
77

88
import static org.assertj.core.api.Assertions.assertThat;
9-
import static org.assertj.core.api.Assertions.entry;
109

1110
import io.opentelemetry.proto.common.v1.KeyValue;
1211
import io.opentelemetry.proto.metrics.v1.Metric;
@@ -47,24 +46,6 @@ static void assertSum(
4746
assertThat(metric.getSum().getIsMonotonic()).isEqualTo(isMonotonic);
4847
}
4948

50-
static void assertTypedGauge(
51-
Metric metric, String name, String description, String unit, List<String> types) {
52-
assertThat(metric.getName()).isEqualTo(name);
53-
assertThat(metric.getDescription()).isEqualTo(description);
54-
assertThat(metric.getUnit()).isEqualTo(unit);
55-
assertThat(metric.hasGauge()).isTrue();
56-
assertTypedPoints(metric.getGauge().getDataPointsList(), types);
57-
}
58-
59-
static void assertTypedSum(
60-
Metric metric, String name, String description, String unit, List<String> types) {
61-
assertThat(metric.getName()).isEqualTo(name);
62-
assertThat(metric.getDescription()).isEqualTo(description);
63-
assertThat(metric.getUnit()).isEqualTo(unit);
64-
assertThat(metric.hasSum()).isTrue();
65-
assertTypedPoints(metric.getSum().getDataPointsList(), types);
66-
}
67-
6849
@SafeVarargs
6950
static void assertSumWithAttributes(
7051
Metric metric,
@@ -122,19 +103,6 @@ static void assertGaugeWithAttributes(
122103
assertAttributedPoints(metric.getGauge().getDataPointsList(), attributeGroupAssertions);
123104
}
124105

125-
@SuppressWarnings("unchecked")
126-
private static void assertTypedPoints(List<NumberDataPoint> points, List<String> types) {
127-
Consumer<MapAssert<String, String>>[] assertions =
128-
types.stream()
129-
.map(
130-
type ->
131-
(Consumer<MapAssert<String, String>>)
132-
attrs -> attrs.containsOnly(entry("name", type)))
133-
.toArray(Consumer[]::new);
134-
135-
assertAttributedPoints(points, assertions);
136-
}
137-
138106
@SuppressWarnings("unchecked")
139107
private static void assertAttributedPoints(
140108
List<NumberDataPoint> points,

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/MetricsVerifier.java

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -57,124 +57,6 @@ public MetricsVerifier add(String metricName, Consumer<MetricAssert> assertion)
5757
return this;
5858
}
5959

60-
// TODO: can now be inlined
61-
@CanIgnoreReturnValue
62-
public MetricsVerifier assertGauge(String metricName, String description, String unit) {
63-
return add(
64-
metricName,
65-
metric ->
66-
metric
67-
.hasDescription(description)
68-
.hasUnit(unit)
69-
.isGauge()
70-
.hasDataPointsWithoutAttributes());
71-
}
72-
73-
@CanIgnoreReturnValue
74-
public MetricsVerifier assertTypedGauge(
75-
String metricName, String description, String unit, List<String> types) {
76-
return add(
77-
metricName,
78-
metric ->
79-
metric.hasDescription(description).hasUnit(unit).isGauge().hasTypedDataPoints(types));
80-
}
81-
82-
// TODO: can now be inlined
83-
@CanIgnoreReturnValue
84-
public MetricsVerifier assertCounter(String metricName, String description, String unit) {
85-
return add(
86-
metricName,
87-
metric ->
88-
metric
89-
.hasDescription(description)
90-
.hasUnit(unit)
91-
.isCounter()
92-
.hasDataPointsWithoutAttributes());
93-
}
94-
95-
// TODO: can now be inlined
96-
@CanIgnoreReturnValue
97-
public MetricsVerifier assertUpDownCounter(String metricName, String description, String unit) {
98-
return add(
99-
metricName,
100-
metric ->
101-
metric
102-
.hasDescription(description)
103-
.hasUnit(unit)
104-
.isUpDownCounter()
105-
.hasDataPointsWithoutAttributes());
106-
}
107-
108-
// TODO: can now be inlined
109-
@SafeVarargs
110-
@CanIgnoreReturnValue
111-
public final MetricsVerifier assertGaugeWithAttributes( // only used in activemq
112-
String metricName, String description, String unit, Map.Entry<String, String>... attributes) {
113-
return add(
114-
metricName,
115-
metric ->
116-
metric
117-
.hasDescription(description)
118-
.hasUnit(unit)
119-
.isGauge()
120-
.hasDataPointsAttributes(attributes));
121-
}
122-
123-
// TODO: can now be inlined
124-
@SafeVarargs
125-
@CanIgnoreReturnValue
126-
public final MetricsVerifier assertCounterWithAttributes(
127-
String metricName, String description, String unit, Map<String, String>... attributeSets) {
128-
return add(
129-
metricName,
130-
metric ->
131-
metric
132-
.hasDescription(description)
133-
.hasUnit(unit)
134-
.isCounter()
135-
.hasDataPointsAttributes(attributeSets));
136-
}
137-
138-
// TODO: can now be inlined
139-
@SafeVarargs
140-
@CanIgnoreReturnValue
141-
public final MetricsVerifier assertCounterWithAttributes(
142-
String metricName, String description, String unit, Map.Entry<String, String>... attributes) {
143-
return add(
144-
metricName,
145-
metric ->
146-
metric
147-
.hasDescription(description)
148-
.hasUnit(unit)
149-
.isCounter()
150-
.hasDataPointsAttributes(attributes));
151-
}
152-
153-
// TODO: can now be inlined
154-
@SafeVarargs
155-
@CanIgnoreReturnValue
156-
public final MetricsVerifier assertUpDownCounterWithAttributes(
157-
String metricName, String description, String unit, Map.Entry<String, String>... attributes) {
158-
return add(
159-
metricName,
160-
metric ->
161-
metric
162-
.hasDescription(description)
163-
.hasUnit(unit)
164-
.isUpDownCounter()
165-
.hasDataPointsAttributes(attributes));
166-
}
167-
168-
// TODO: can now be inlined
169-
@CanIgnoreReturnValue
170-
public MetricsVerifier assertTypedCounter(
171-
String metricName, String description, String unit, List<String> types) {
172-
return add(
173-
metricName,
174-
metric ->
175-
metric.hasDescription(description).hasUnit(unit).isCounter().hasTypedDataPoints(types));
176-
}
177-
17860
public void verify(List<Metric> metrics) {
17961
verifyAllExpectedMetricsWereReceived(metrics);
18062

0 commit comments

Comments
 (0)