Search in sources :

Example 1 with SystemTimer

use of com.yahoo.jdisc.core.SystemTimer in project vespa by vespa-engine.

the class StateMonitorBenchmarkTest method requireThatHealthMonitorDoesNotBlockMetricThreads.

@Test
public void requireThatHealthMonitorDoesNotBlockMetricThreads() throws Exception {
    StateMonitor monitor = new StateMonitor(new HealthMonitorConfig(new HealthMonitorConfig.Builder()), new SystemTimer());
    Provider<MetricConsumer> provider = MetricConsumerProviders.wrap(monitor);
    performUpdates(provider, 8);
    for (int i = 1; i <= NUM_THREADS; i *= 2) {
        long millis = performUpdates(provider, i);
        System.err.format("%2d threads, %5d millis => %9d ups\n", i, millis, (int) ((i * NUM_UPDATES) / (millis / 1000.0)));
    }
    monitor.deconstruct();
}
Also used : MetricConsumer(com.yahoo.jdisc.application.MetricConsumer) HealthMonitorConfig(com.yahoo.container.jdisc.config.HealthMonitorConfig) SystemTimer(com.yahoo.jdisc.core.SystemTimer) Test(org.junit.Test)

Aggregations

HealthMonitorConfig (com.yahoo.container.jdisc.config.HealthMonitorConfig)1 MetricConsumer (com.yahoo.jdisc.application.MetricConsumer)1 SystemTimer (com.yahoo.jdisc.core.SystemTimer)1 Test (org.junit.Test)1