use of com.codahale.metrics.SlidingTimeWindowReservoir in project lucene-solr by apache.
the class MetricsConfigTest method testCustomReservoir.
@Test
public void testCustomReservoir() throws Exception {
System.setProperty("timer.reservoir", UniformReservoir.class.getName());
System.setProperty("histogram.size", "2048");
System.setProperty("histogram.window", "600");
System.setProperty("histogram.reservoir", SlidingTimeWindowReservoir.class.getName());
NodeConfig cfg = loadNodeConfig();
SolrMetricManager mgr = new SolrMetricManager(loader, cfg.getMetricsConfig());
assertTrue(mgr.getCounterSupplier() instanceof MetricSuppliers.DefaultCounterSupplier);
assertTrue(mgr.getMeterSupplier() instanceof MetricSuppliers.DefaultMeterSupplier);
assertTrue(mgr.getTimerSupplier() instanceof MetricSuppliers.DefaultTimerSupplier);
assertTrue(mgr.getHistogramSupplier() instanceof MetricSuppliers.DefaultHistogramSupplier);
Reservoir rsv = ((MetricSuppliers.DefaultTimerSupplier) mgr.getTimerSupplier()).getReservoir();
assertTrue(rsv instanceof UniformReservoir);
rsv = ((MetricSuppliers.DefaultHistogramSupplier) mgr.getHistogramSupplier()).getReservoir();
assertTrue(rsv instanceof SlidingTimeWindowReservoir);
}
Aggregations