You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/MetricAssertions.java
Copy file name to clipboardExpand all lines: jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/MetricsVerifier.java
+27-2Lines changed: 27 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ private MetricsVerifier() {}
29
29
/**
30
30
* Create instance of MetricsVerifier configured to fail verification if any metric was not
31
31
* verified because there is no assertion defined for it. This behavior can be changed by calling
32
-
* allowingExtraMetrics() method.
32
+
* {@link #disableStrictMode()} method.
33
33
*
34
34
* @return new instance of MetricsVerifier
35
35
* @see #disableStrictMode()
@@ -38,12 +38,29 @@ public static MetricsVerifier create() {
38
38
returnnewMetricsVerifier();
39
39
}
40
40
41
+
/**
42
+
* Disable strict checks of metric assertions. It means that all metrics checks added after
43
+
* calling this method will not enforce asserting all metric properties and will not detect
44
+
* duplicate property assertions. Also, there will be no error reported if any of metrics was
45
+
* skipped because no assertion was added for it.
46
+
*
47
+
* @return this
48
+
* @see #verify(List)
49
+
* @see #add(String, Consumer)
50
+
*/
41
51
@CanIgnoreReturnValue
42
52
publicMetricsVerifierdisableStrictMode() {
43
53
strictMode = false;
44
54
returnthis;
45
55
}
46
56
57
+
/**
58
+
* Add assertion for given metric
59
+
*
60
+
* @param metricName name of metric to be verified by provided assertion
61
+
* @param assertion an assertion to verify properties of the metric
0 commit comments