MetricsConfig { public int reservoirTtl() { return optionalInt(config, "metrics.reservoir-ttl").orElse(DEFAULT_TTL_SECONDS); } @Inject  MetricsConfig(Config config); DurationThresholdConfig durationThresholdConfig(); Set<What> serverMetrics(); Set<Integer> precreateCodes(); int reservoirTtl();  }
@Test public void testDefaultreservoirTtl() { assertThat(new MetricsConfig(ConfigFactory.empty()).reservoirTtl(), is(300)); }
@Test public void testOverrideDefaultreservoirTtl() { assertThat(new MetricsConfig(ConfigFactory.parseString( "metrics.reservoir-ttl: 30")).reservoirTtl(), is(30)); }