@DataProvider(value = {
"42 | DAYS",
"123 | SECONDS",
"999 | MILLISECONDS",
"3 | HOURS"
}, splitBy = "\\|")
@Test
public void RollingWindowHistogramBuilder_newMetric_creates_new_histogram_with_SlidingTimeWindowReservoir_with_expected_values(
long amount, TimeUnit timeUnit
) {
// given
RollingWindowHistogramBuilder rwhb = new RollingWindowHistogramBuilder(amount, timeUnit);
// when
Histogram histogram = rwhb.newMetric();
// then
Reservoir reservoir = (Reservoir) getInternalState(histogram, "reservoir");
assertThat(reservoir).isInstanceOf(SlidingTimeWindowReservoir.class);
// The expected value here comes from logic in the SlidingTimeWindowReservoir constructor.
assertThat(getInternalState(reservoir, "window")).isEqualTo(timeUnit.toNanos(amount) * 256);
}
SignalFxEndpointMetricsHandlerTest.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:riposte
作者:
评论列表
文章目录