use of com.hotels.styx.api.MicrometerRegistry in project styx by ExpediaGroup.
the class StyxServerTest method disablesResourceLeakDetectionByDefault.
@Test
public void disablesResourceLeakDetectionByDefault() {
StyxServerComponents config = new StyxServerComponents.Builder().registry(new MicrometerRegistry(new CompositeMeterRegistry())).configuration(EMPTY_CONFIGURATION).additionalServices(Map.of("backendServiceRegistry", new RegistryServiceAdapter(new MemoryBackedRegistry<>()))).build();
new StyxServer(config);
assertThat(ResourceLeakDetector.getLevel(), is(DISABLED));
}
use of com.hotels.styx.api.MicrometerRegistry in project styx by ExpediaGroup.
the class OriginsInventoryTest method setUp.
@BeforeEach
public void setUp() {
meterRegistry = new MicrometerRegistry(new SimpleMeterRegistry());
logger = new LoggingTestSupport(OriginsInventory.class);
monitor = mock(OriginHealthStatusMonitor.class);
eventBus = mock(EventBus.class);
inventory = new OriginsInventory(eventBus, GENERIC_APP, monitor, connectionFactory, hostClientFactory, new CentralisedMetrics(meterRegistry));
}
use of com.hotels.styx.api.MicrometerRegistry in project styx by ExpediaGroup.
the class StyxBackendServiceClientTest method setUp.
@BeforeEach
public void setUp() {
meterRegistry = new MicrometerRegistry(new SimpleMeterRegistry());
metrics = new CentralisedMetrics(meterRegistry);
}
use of com.hotels.styx.api.MicrometerRegistry in project styx by ExpediaGroup.
the class SimpleConnectionPoolFactoryTest method registersMetricsUnderOriginsScope.
@Test
public void registersMetricsUnderOriginsScope() {
MeterRegistry meterRegistry = new MicrometerRegistry(new SimpleMeterRegistry());
SimpleConnectionPoolFactory factory = new SimpleConnectionPoolFactory.Builder().connectionFactory(mock(Connection.Factory.class)).connectionPoolSettings(defaultConnectionPoolSettings()).metrics(new CentralisedMetrics(meterRegistry)).build();
factory.create(origin);
Tags tags = Tags.of("appId", "test-app", "originId", "origin-X");
assertThat(meterRegistry.find("proxy.client.connectionpool.pendingConnections").tags(tags).gauge(), notNullValue());
assertThat(meterRegistry.find("proxy.client.connectionpool.availableConnections").tags(tags).gauge(), notNullValue());
assertThat(meterRegistry.find("proxy.client.connectionpool.busyConnections").tags(tags).gauge(), notNullValue());
assertThat(meterRegistry.find("proxy.client.connectionpool.connectionsInEstablishment").tags(tags).gauge(), notNullValue());
}
use of com.hotels.styx.api.MicrometerRegistry in project styx by ExpediaGroup.
the class HttpPipelineHandlerTest method updatesRequestsOngoingCountOnChannelReadEvent.
@Test
public void updatesRequestsOngoingCountOnChannelReadEvent() throws Exception {
MeterRegistry registry = new MicrometerRegistry(new SimpleMeterRegistry());
HttpPipelineHandler pipelineHandler = handlerWithMocks(doNotRespondHandler).responseEnhancer(DO_NOT_MODIFY_RESPONSE).progressListener(new RequestStatsCollector(new CentralisedMetrics(registry))).build();
ChannelHandlerContext ctx = mockCtx();
pipelineHandler.channelActive(ctx);
pipelineHandler.channelRead0(ctx, get("/foo").build());
assertThat(requestOutstandingValue(registry), is(1.0));
}
Aggregations