use of org.apache.knox.gateway.services.metrics.InstrumentationProvider in project knox by apache.
the class DefaultMetricsServiceTest method instrumentationProvidersLoading.
@Test
public void instrumentationProvidersLoading() throws Exception {
DefaultMetricsService service = new DefaultMetricsService();
GatewayConfigImpl config = new GatewayConfigImpl();
config.set(GatewayConfigImpl.METRICS_ENABLED, "true");
service.init(config, null);
Map<Class<?>, InstrumentationProvider> map = service.getInstrumentationProviders();
Assert.assertTrue(map.entrySet().size() >= 2);
Assert.assertNotNull(service.getInstrumented(HttpClientBuilder.class));
}
use of org.apache.knox.gateway.services.metrics.InstrumentationProvider in project knox by apache.
the class DefaultMetricsServiceTest method instrumentationProvidersLoadingDefaultIsEmpty.
@Test
public void instrumentationProvidersLoadingDefaultIsEmpty() throws Exception {
DefaultMetricsService service = new DefaultMetricsService();
service.init(new GatewayConfigImpl(), null);
Map<Class<?>, InstrumentationProvider> map = service.getInstrumentationProviders();
Assert.assertTrue(map.entrySet().isEmpty());
Assert.assertNull(service.getInstrumented(HttpClientBuilder.class));
}
Aggregations