use of com.yahoo.metrics.MetricsPresentationConfig in project vespa by vespa-engine.
the class StateHandlerTest method startTestDriver.
@Before
public void startTestDriver() {
Timer timer = this.currentTimeMillis::get;
this.driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi(new AbstractModule() {
@Override
protected void configure() {
bind(Timer.class).toInstance(timer);
}
});
ContainerBuilder builder = driver.newContainerBuilder();
HealthMonitorConfig healthMonitorConfig = new HealthMonitorConfig(new HealthMonitorConfig.Builder().snapshot_interval(TimeUnit.MILLISECONDS.toSeconds(SNAPSHOT_INTERVAL)));
ThreadFactory threadFactory = ignored -> mock(Thread.class);
this.monitor = new StateMonitor(healthMonitorConfig, timer, threadFactory);
builder.guiceModules().install(new AbstractModule() {
@Override
protected void configure() {
bind(StateMonitor.class).toInstance(monitor);
bind(MetricConsumer.class).toProvider(MetricConsumerProviders.wrap(monitor));
bind(ApplicationMetadataConfig.class).toInstance(new ApplicationMetadataConfig(new ApplicationMetadataConfig.Builder().generation(META_GENERATION)));
bind(MetricsPresentationConfig.class).toInstance(new MetricsPresentationConfig(new MetricsPresentationConfig.Builder()));
}
});
builder.serverBindings().bind("http://*/*", builder.getInstance(StateHandler.class));
driver.activateContainer(builder);
metric = builder.getInstance(Metric.class);
}
Aggregations