We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f705841 commit 98c5c7bCopy full SHA for 98c5c7b
1 file changed
prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/GaugeTest.java
@@ -82,12 +82,11 @@ void testSet() {
82
}
83
84
@Test
85
- @SuppressWarnings("try")
86
- public void testTimer() throws InterruptedException {
87
- try (Timer ignored = noLabels.startTimer()) {
88
- Thread.sleep(12);
89
- }
90
- assertThat(getValue(noLabels)).isGreaterThan(0.01);
+ void testTimer() {
+ Timer timer = noLabels.startTimer();
+ double duration = timer.observeDuration();
+ assertThat(duration).isPositive();
+ assertThat(getValue(noLabels)).isEqualTo(duration);
91
92
93
0 commit comments