This commit is contained in:
Diane Duan 2017-02-06 17:47:57 +08:00
parent 13f2eef879
commit 9f77fecd15
1 changed files with 3 additions and 3 deletions

View File

@ -138,15 +138,15 @@ public class MetricsTest {
long elapsed1 = context1.stop();
assertEquals(5000000000L, elapsed1, 10000000);
assertEquals(5000000000L, elapsed1, 1000000000);
assertThat(timer.getCount(), equalTo(1L));
assertEquals(0.2, timer.getMeanRate(), 0.1);
assertEquals(0.2, timer.getMeanRate(), 0.2);
Timer.Context context2 = timer.time();
TimeUnit.SECONDS.sleep(2);
context2.close();
assertThat(timer.getCount(), equalTo(2L));
assertEquals(0.3, timer.getMeanRate(), 0.1);
assertEquals(0.3, timer.getMeanRate(), 0.2);
}
}