Search in sources :

Example 6 with SlidingTimeWindowReservoir

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);
}
Also used : SlidingTimeWindowReservoir(com.codahale.metrics.SlidingTimeWindowReservoir) UniformReservoir(com.codahale.metrics.UniformReservoir) Reservoir(com.codahale.metrics.Reservoir) ExponentiallyDecayingReservoir(com.codahale.metrics.ExponentiallyDecayingReservoir) UniformReservoir(com.codahale.metrics.UniformReservoir) SlidingTimeWindowReservoir(com.codahale.metrics.SlidingTimeWindowReservoir) NodeConfig(org.apache.solr.core.NodeConfig) Test(org.junit.Test)

Aggregations

SlidingTimeWindowReservoir (com.codahale.metrics.SlidingTimeWindowReservoir)6 Histogram (com.codahale.metrics.Histogram)4 Reservoir (com.codahale.metrics.Reservoir)4 Test (org.junit.Test)3 ExponentiallyDecayingReservoir (com.codahale.metrics.ExponentiallyDecayingReservoir)2 UniformReservoir (com.codahale.metrics.UniformReservoir)2 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)2 Clock (com.codahale.metrics.Clock)1 SlidingWindowReservoir (com.codahale.metrics.SlidingWindowReservoir)1 Timer (com.codahale.metrics.Timer)1 RollingWindowHistogramBuilder (com.nike.riposte.metrics.codahale.impl.SignalFxEndpointMetricsHandler.RollingWindowHistogramBuilder)1 RollingWindowTimerBuilder (com.nike.riposte.metrics.codahale.impl.SignalFxEndpointMetricsHandler.RollingWindowTimerBuilder)1 NodeConfig (org.apache.solr.core.NodeConfig)1 PluginInfoInitialized (org.apache.solr.util.plugin.PluginInfoInitialized)1