Remove Old Gauge and correct exception messages (#1502)
diff --git a/api/src/main/java/io/opencensus/metrics/DoubleGauge.java b/api/src/main/java/io/opencensus/metrics/DoubleGauge.java
index 62730a0..de2b053 100644
--- a/api/src/main/java/io/opencensus/metrics/DoubleGauge.java
+++ b/api/src/main/java/io/opencensus/metrics/DoubleGauge.java
@@ -172,15 +172,15 @@
Utils.checkNotNull(name, "name");
Utils.checkNotNull(description, "description");
Utils.checkNotNull(unit, "unit");
- Utils.checkNotNull(labelKeys, "labelKeys should not be null.");
- Utils.checkListElementNotNull(labelKeys, "labelKeys element should not be null.");
+ Utils.checkListElementNotNull(
+ Utils.checkNotNull(labelKeys, "labelKeys"), "labelKey element should not be null.");
labelKeysSize = labelKeys.size();
}
@Override
public NoopDoublePoint getOrCreateTimeSeries(List<LabelValue> labelValues) {
- Utils.checkNotNull(labelValues, "labelValues should not be null.");
- Utils.checkListElementNotNull(labelValues, "labelValues element should not be null.");
+ Utils.checkListElementNotNull(
+ Utils.checkNotNull(labelValues, "labelValues"), "labelValue element should not be null.");
Utils.checkArgument(labelKeysSize == labelValues.size(), "Incorrect number of labels.");
return NoopDoublePoint.INSTANCE;
}
@@ -192,7 +192,7 @@
@Override
public void removeTimeSeries(List<LabelValue> labelValues) {
- Utils.checkNotNull(labelValues, "labelValues should not be null.");
+ Utils.checkNotNull(labelValues, "labelValues");
}
@Override
diff --git a/api/src/main/java/io/opencensus/metrics/LongGauge.java b/api/src/main/java/io/opencensus/metrics/LongGauge.java
index f473a8a..8ca760b 100644
--- a/api/src/main/java/io/opencensus/metrics/LongGauge.java
+++ b/api/src/main/java/io/opencensus/metrics/LongGauge.java
@@ -171,8 +171,8 @@
@Override
public NoopLongPoint getOrCreateTimeSeries(List<LabelValue> labelValues) {
- Utils.checkNotNull(labelValues, "labelValues should not be null.");
- Utils.checkListElementNotNull(labelValues, "labelValues element should not be null.");
+ Utils.checkListElementNotNull(
+ Utils.checkNotNull(labelValues, "labelValues"), "labelValue element should not be null.");
Utils.checkArgument(labelKeysSize == labelValues.size(), "Incorrect number of labels.");
return NoopLongPoint.INSTANCE;
}
@@ -184,7 +184,7 @@
@Override
public void removeTimeSeries(List<LabelValue> labelValues) {
- Utils.checkNotNull(labelValues, "labelValues should not be null.");
+ Utils.checkNotNull(labelValues, "labelValues");
}
@Override
diff --git a/api/src/main/java/io/opencensus/stats/Aggregation.java b/api/src/main/java/io/opencensus/stats/Aggregation.java
index f5efed9..9c95e84 100644
--- a/api/src/main/java/io/opencensus/stats/Aggregation.java
+++ b/api/src/main/java/io/opencensus/stats/Aggregation.java
@@ -180,7 +180,7 @@
* @since 0.8
*/
public static Distribution create(BucketBoundaries bucketBoundaries) {
- Utils.checkNotNull(bucketBoundaries, "bucketBoundaries should not be null.");
+ Utils.checkNotNull(bucketBoundaries, "bucketBoundaries");
return new AutoValue_Aggregation_Distribution(bucketBoundaries);
}
diff --git a/api/src/main/java/io/opencensus/stats/AggregationData.java b/api/src/main/java/io/opencensus/stats/AggregationData.java
index eb7d40b..c6e12b6 100644
--- a/api/src/main/java/io/opencensus/stats/AggregationData.java
+++ b/api/src/main/java/io/opencensus/stats/AggregationData.java
@@ -288,15 +288,15 @@
Utils.checkArgument(min <= max, "max should be greater or equal to min.");
}
- Utils.checkNotNull(bucketCounts, "bucket counts should not be null.");
+ Utils.checkNotNull(bucketCounts, "bucketCounts");
List<Long> bucketCountsCopy = Collections.unmodifiableList(new ArrayList<Long>(bucketCounts));
for (Long bucket : bucketCountsCopy) {
- Utils.checkNotNull(bucket, "bucket should not be null.");
+ Utils.checkNotNull(bucket, "bucket");
}
Utils.checkNotNull(exemplars, "exemplar list should not be null.");
for (Exemplar exemplar : exemplars) {
- Utils.checkNotNull(exemplar, "exemplar should not be null.");
+ Utils.checkNotNull(exemplar, "exemplar");
}
return new AutoValue_AggregationData_DistributionData(
diff --git a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
index 573a9e1..61e21e6 100644
--- a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
+++ b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
@@ -42,7 +42,7 @@
* @since 0.8
*/
public static final BucketBoundaries create(List<Double> bucketBoundaries) {
- Utils.checkNotNull(bucketBoundaries, "bucketBoundaries list should not be null.");
+ Utils.checkNotNull(bucketBoundaries, "bucketBoundaries");
List<Double> bucketBoundariesCopy = new ArrayList<Double>(bucketBoundaries); // Deep copy.
// Check if sorted.
if (bucketBoundariesCopy.size() > 1) {
diff --git a/api/src/test/java/io/opencensus/metrics/DoubleGaugeTest.java b/api/src/test/java/io/opencensus/metrics/DoubleGaugeTest.java
index 5690bd4..b0cdea7 100644
--- a/api/src/test/java/io/opencensus/metrics/DoubleGaugeTest.java
+++ b/api/src/test/java/io/opencensus/metrics/DoubleGaugeTest.java
@@ -49,7 +49,7 @@
DoubleGauge doubleGauge =
DoubleGauge.newNoopDoubleGauge(NAME, DESCRIPTION, UNIT, EMPTY_LABEL_KEYS);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
doubleGauge.getOrCreateTimeSeries(null);
}
@@ -58,7 +58,7 @@
List<LabelValue> labelValues = Collections.singletonList(null);
DoubleGauge doubleGauge = DoubleGauge.newNoopDoubleGauge(NAME, DESCRIPTION, UNIT, LABEL_KEY);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues element should not be null.");
+ thrown.expectMessage("labelValue element should not be null.");
doubleGauge.getOrCreateTimeSeries(labelValues);
}
@@ -74,7 +74,7 @@
public void noopRemoveTimeSeries_WithNullLabelValues() {
DoubleGauge doubleGauge = DoubleGauge.newNoopDoubleGauge(NAME, DESCRIPTION, UNIT, LABEL_KEY);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
doubleGauge.removeTimeSeries(null);
}
diff --git a/api/src/test/java/io/opencensus/metrics/LongGaugeTest.java b/api/src/test/java/io/opencensus/metrics/LongGaugeTest.java
index 768abe0..eedb287 100644
--- a/api/src/test/java/io/opencensus/metrics/LongGaugeTest.java
+++ b/api/src/test/java/io/opencensus/metrics/LongGaugeTest.java
@@ -48,7 +48,7 @@
public void noopGetOrCreateTimeSeries_WithNullLabelValues() {
LongGauge longGauge = LongGauge.newNoopLongGauge(NAME, DESCRIPTION, UNIT, EMPTY_LABEL_KEYS);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
longGauge.getOrCreateTimeSeries(null);
}
@@ -57,7 +57,7 @@
List<LabelValue> labelValues = Collections.singletonList(null);
LongGauge longGauge = LongGauge.newNoopLongGauge(NAME, DESCRIPTION, UNIT, LABEL_KEY);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues element should not be null.");
+ thrown.expectMessage("labelValue element should not be null.");
longGauge.getOrCreateTimeSeries(labelValues);
}
@@ -73,7 +73,7 @@
public void noopRemoveTimeSeries_WithNullLabelValues() {
LongGauge longGauge = LongGauge.newNoopLongGauge(NAME, DESCRIPTION, UNIT, LABEL_KEY);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
longGauge.removeTimeSeries(null);
}
diff --git a/api/src/test/java/io/opencensus/stats/AggregationDataTest.java b/api/src/test/java/io/opencensus/stats/AggregationDataTest.java
index 6055160..a6d6d1d 100644
--- a/api/src/test/java/io/opencensus/stats/AggregationDataTest.java
+++ b/api/src/test/java/io/opencensus/stats/AggregationDataTest.java
@@ -108,14 +108,14 @@
@Test
public void preventNullBucketCountList() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("bucket counts should not be null.");
+ thrown.expectMessage("bucketCounts");
DistributionData.create(1, 1, 1, 1, 0, null);
}
@Test
public void preventNullBucket() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("bucket should not be null.");
+ thrown.expectMessage("bucket");
DistributionData.create(1, 1, 1, 1, 0, Arrays.asList(0L, 1L, null));
}
@@ -129,7 +129,7 @@
@Test
public void preventNullExemplar() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("exemplar should not be null.");
+ thrown.expectMessage("exemplar");
DistributionData.create(
1, 1, 1, 1, 0, Arrays.asList(0L, 1L, 1L), Collections.<Exemplar>singletonList(null));
}
diff --git a/api/src/test/java/io/opencensus/stats/AggregationTest.java b/api/src/test/java/io/opencensus/stats/AggregationTest.java
index c2e6a71..cf33703 100644
--- a/api/src/test/java/io/opencensus/stats/AggregationTest.java
+++ b/api/src/test/java/io/opencensus/stats/AggregationTest.java
@@ -50,7 +50,7 @@
@Test
public void testNullBucketBoundaries() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("bucketBoundaries should not be null.");
+ thrown.expectMessage("bucketBoundaries");
Distribution.create(null);
}
diff --git a/impl_core/src/main/java/io/opencensus/implcore/metrics/DoubleGaugeImpl.java b/impl_core/src/main/java/io/opencensus/implcore/metrics/DoubleGaugeImpl.java
index d329091..86b3512 100644
--- a/impl_core/src/main/java/io/opencensus/implcore/metrics/DoubleGaugeImpl.java
+++ b/impl_core/src/main/java/io/opencensus/implcore/metrics/DoubleGaugeImpl.java
@@ -70,8 +70,7 @@
List<LabelValue> labelValuesCopy =
Collections.unmodifiableList(
- new ArrayList<LabelValue>(
- checkNotNull(labelValues, "labelValues should not be null.")));
+ new ArrayList<LabelValue>(checkNotNull(labelValues, "labelValues")));
return registerTimeSeries(labelValuesCopy);
}
@@ -87,7 +86,7 @@
@Override
public synchronized void removeTimeSeries(List<LabelValue> labelValues) {
- checkNotNull(labelValues, "labelValues should not be null.");
+ checkNotNull(labelValues, "labelValues");
Map<List<LabelValue>, PointImpl> registeredPointsCopy =
new LinkedHashMap<List<LabelValue>, PointImpl>(registeredPoints);
@@ -112,7 +111,7 @@
}
checkArgument(labelKeysSize == labelValues.size(), "Incorrect number of labels.");
- Utils.checkListElementNotNull(labelValues, "labelValues element should not be null.");
+ Utils.checkListElementNotNull(labelValues, "labelValue element should not be null.");
PointImpl newPoint = new PointImpl(labelValues);
// Updating the map of points happens under a lock to avoid multiple add operations
diff --git a/impl_core/src/main/java/io/opencensus/implcore/metrics/Gauge.java b/impl_core/src/main/java/io/opencensus/implcore/metrics/Gauge.java
deleted file mode 100644
index e52fcff..0000000
--- a/impl_core/src/main/java/io/opencensus/implcore/metrics/Gauge.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2018, OpenCensus Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.opencensus.implcore.metrics;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import io.opencensus.common.Clock;
-import io.opencensus.common.ToDoubleFunction;
-import io.opencensus.common.ToLongFunction;
-import io.opencensus.metrics.LabelKey;
-import io.opencensus.metrics.LabelValue;
-import io.opencensus.metrics.export.Metric;
-import io.opencensus.metrics.export.MetricDescriptor;
-import io.opencensus.metrics.export.MetricDescriptor.Type;
-import io.opencensus.metrics.export.Point;
-import io.opencensus.metrics.export.TimeSeries;
-import io.opencensus.metrics.export.Value;
-import java.util.Collections;
-import java.util.List;
-
-abstract class Gauge {
- private final MetricDescriptor metricDescriptor;
- private final List<LabelValue> labelValues;
-
- final Metric getMetric(Clock clock) {
- return Metric.createWithOneTimeSeries(metricDescriptor, getTimeSeries(clock));
- }
-
- abstract TimeSeries getTimeSeries(Clock clock);
-
- static final class DoubleGauge<T> extends Gauge {
- private final T obj;
- private final ToDoubleFunction<T> function;
-
- DoubleGauge(
- String name,
- String description,
- String unit,
- List<LabelKey> labelKeys,
- List<LabelValue> labelValues,
- T obj,
- ToDoubleFunction<T> function) {
- super(
- MetricDescriptor.create(name, description, unit, Type.GAUGE_DOUBLE, labelKeys),
- labelValues);
- this.obj = obj;
- this.function = function;
- }
-
- @Override
- TimeSeries getTimeSeries(Clock clock) {
- return TimeSeries.createWithOnePoint(
- getLabelValues(),
- Point.create(Value.doubleValue(function.applyAsDouble(obj)), clock.now()),
- null);
- }
- }
-
- static final class LongGauge<T> extends Gauge {
- private final T obj;
- private final ToLongFunction<T> function;
-
- LongGauge(
- String name,
- String description,
- String unit,
- List<LabelKey> labelKeys,
- List<LabelValue> labelValues,
- T obj,
- ToLongFunction<T> function) {
- super(
- MetricDescriptor.create(name, description, unit, Type.GAUGE_INT64, labelKeys),
- labelValues);
- this.obj = obj;
- this.function = function;
- }
-
- @Override
- TimeSeries getTimeSeries(Clock clock) {
- return TimeSeries.createWithOnePoint(
- getLabelValues(),
- Point.create(Value.longValue(function.applyAsLong(obj)), clock.now()),
- null);
- }
- }
-
- List<LabelValue> getLabelValues() {
- return labelValues;
- }
-
- Gauge(MetricDescriptor metricDescriptor, List<LabelValue> labelValues) {
- this.metricDescriptor = checkNotNull(metricDescriptor, "metricDescriptor");
- this.labelValues = Collections.unmodifiableList(labelValues);
- }
-}
diff --git a/impl_core/src/main/java/io/opencensus/implcore/metrics/LongGaugeImpl.java b/impl_core/src/main/java/io/opencensus/implcore/metrics/LongGaugeImpl.java
index 64cb320..f158e65 100644
--- a/impl_core/src/main/java/io/opencensus/implcore/metrics/LongGaugeImpl.java
+++ b/impl_core/src/main/java/io/opencensus/implcore/metrics/LongGaugeImpl.java
@@ -70,8 +70,7 @@
List<LabelValue> labelValuesCopy =
Collections.unmodifiableList(
- new ArrayList<LabelValue>(
- checkNotNull(labelValues, "labelValues should not be null.")));
+ new ArrayList<LabelValue>(checkNotNull(labelValues, "labelValues")));
return registerTimeSeries(labelValuesCopy);
}
@@ -87,7 +86,7 @@
@Override
public synchronized void removeTimeSeries(List<LabelValue> labelValues) {
- checkNotNull(labelValues, "labelValues should not be null.");
+ checkNotNull(labelValues, "labelValues");
Map<List<LabelValue>, PointImpl> registeredPointsCopy =
new LinkedHashMap<List<LabelValue>, PointImpl>(registeredPoints);
@@ -112,7 +111,7 @@
}
checkArgument(labelKeysSize == labelValues.size(), "Incorrect number of labels.");
- Utils.checkListElementNotNull(labelValues, "labelValues element should not be null.");
+ Utils.checkListElementNotNull(labelValues, "labelValue element should not be null.");
PointImpl newPoint = new PointImpl(labelValues);
// Updating the map of points happens under a lock to avoid multiple add operations
diff --git a/impl_core/src/test/java/io/opencensus/implcore/metrics/DoubleGaugeImplTest.java b/impl_core/src/test/java/io/opencensus/implcore/metrics/DoubleGaugeImplTest.java
index 61de77b..b089908 100644
--- a/impl_core/src/test/java/io/opencensus/implcore/metrics/DoubleGaugeImplTest.java
+++ b/impl_core/src/test/java/io/opencensus/implcore/metrics/DoubleGaugeImplTest.java
@@ -69,7 +69,7 @@
@Test
public void getOrCreateTimeSeries_WithNullLabelValues() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
doubleGauge.getOrCreateTimeSeries(null);
}
@@ -82,7 +82,7 @@
DoubleGaugeImpl doubleGauge =
new DoubleGaugeImpl(METRIC_NAME, METRIC_DESCRIPTION, METRIC_UNIT, labelKeys);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues element should not be null.");
+ thrown.expectMessage("labelValue element should not be null.");
doubleGauge.getOrCreateTimeSeries(labelValues);
}
@@ -174,7 +174,7 @@
@Test
public void removeTimeSeries_WithNullLabelValues() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
doubleGauge.removeTimeSeries(null);
}
diff --git a/impl_core/src/test/java/io/opencensus/implcore/metrics/GaugeTest.java b/impl_core/src/test/java/io/opencensus/implcore/metrics/GaugeTest.java
deleted file mode 100644
index 4c4c3a9..0000000
--- a/impl_core/src/test/java/io/opencensus/implcore/metrics/GaugeTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2018, OpenCensus Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.opencensus.implcore.metrics;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import io.opencensus.common.Timestamp;
-import io.opencensus.common.ToDoubleFunction;
-import io.opencensus.common.ToLongFunction;
-import io.opencensus.implcore.metrics.Gauge.DoubleGauge;
-import io.opencensus.implcore.metrics.Gauge.LongGauge;
-import io.opencensus.metrics.LabelKey;
-import io.opencensus.metrics.LabelValue;
-import io.opencensus.metrics.export.Metric;
-import io.opencensus.metrics.export.MetricDescriptor;
-import io.opencensus.metrics.export.MetricDescriptor.Type;
-import io.opencensus.metrics.export.Point;
-import io.opencensus.metrics.export.TimeSeries;
-import io.opencensus.metrics.export.Value;
-import io.opencensus.testing.common.TestClock;
-import java.util.Collections;
-import java.util.List;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/** Unit tests for {@link Gauge}. */
-@RunWith(JUnit4.class)
-public class GaugeTest {
- private static final String NAME = "name";
- private static final String DESCRIPTION = "description";
- private static final String UNIT = "1";
- private static final List<LabelKey> LABEL_KEYS =
- Collections.unmodifiableList(
- Collections.singletonList(LabelKey.create("key", "key description")));
- private static final List<LabelValue> LABEL_VALUES =
- Collections.unmodifiableList(Collections.singletonList(LabelValue.create("value")));
- private static final Object OBJ = new Object();
- private static final Timestamp TEST_TIME = Timestamp.create(1234, 123);
-
- private final Gauge longGauge =
- new LongGauge<Object>(
- NAME,
- DESCRIPTION,
- UNIT,
- LABEL_KEYS,
- LABEL_VALUES,
- OBJ,
- new ToLongFunction<Object>() {
- @Override
- public long applyAsLong(Object value) {
- return value.hashCode();
- }
- });
- private final Gauge doubleGauge =
- new DoubleGauge<Object>(
- NAME,
- DESCRIPTION,
- UNIT,
- LABEL_KEYS,
- LABEL_VALUES,
- OBJ,
- new ToDoubleFunction<Object>() {
- @Override
- public double applyAsDouble(Object value) {
- return value.hashCode();
- }
- });
- private final TestClock testClock = TestClock.create(TEST_TIME);
-
- @Test
- public void longGauge_GetMetric() {
- assertThat(longGauge.getMetric(testClock))
- .isEqualTo(
- Metric.createWithOneTimeSeries(
- MetricDescriptor.create(NAME, DESCRIPTION, UNIT, Type.GAUGE_INT64, LABEL_KEYS),
- TimeSeries.createWithOnePoint(
- LABEL_VALUES, Point.create(Value.longValue(OBJ.hashCode()), TEST_TIME), null)));
- }
-
- @Test
- public void doubleGauge_GetMetric() {
- assertThat(doubleGauge.getMetric(testClock))
- .isEqualTo(
- Metric.createWithOneTimeSeries(
- MetricDescriptor.create(NAME, DESCRIPTION, UNIT, Type.GAUGE_DOUBLE, LABEL_KEYS),
- TimeSeries.createWithOnePoint(
- LABEL_VALUES,
- Point.create(Value.doubleValue(OBJ.hashCode()), TEST_TIME),
- null)));
- }
-}
diff --git a/impl_core/src/test/java/io/opencensus/implcore/metrics/LongGaugeImplTest.java b/impl_core/src/test/java/io/opencensus/implcore/metrics/LongGaugeImplTest.java
index 25797cf..e83bb64 100644
--- a/impl_core/src/test/java/io/opencensus/implcore/metrics/LongGaugeImplTest.java
+++ b/impl_core/src/test/java/io/opencensus/implcore/metrics/LongGaugeImplTest.java
@@ -69,7 +69,7 @@
@Test
public void getOrCreateTimeSeries_WithNullLabelValues() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
longGaugeMetric.getOrCreateTimeSeries(null);
}
@@ -82,7 +82,7 @@
LongGaugeImpl longGauge =
new LongGaugeImpl(METRIC_NAME, METRIC_DESCRIPTION, METRIC_UNIT, labelKeys);
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues element should not be null.");
+ thrown.expectMessage("labelValue element should not be null.");
longGauge.getOrCreateTimeSeries(labelValues);
}
@@ -169,7 +169,7 @@
@Test
public void removeTimeSeries_WithNullLabelValues() {
thrown.expect(NullPointerException.class);
- thrown.expectMessage("labelValues should not be null.");
+ thrown.expectMessage("labelValues");
longGaugeMetric.removeTimeSeries(null);
}