use of com.palantir.tritium.metrics.registry.MetricName in project conjure-java-runtime by palantir.
the class OkHttpClientsTest method verifyGlobalMetricsAreRegistered.
@Test
public /**
* See {@link DispatcherMetricSet}.
*/
void verifyGlobalMetricsAreRegistered() {
TaggedMetricRegistry registry = DefaultTaggedMetricRegistry.getDefault();
ClientConfiguration clientConfiguration = ClientConfiguration.builder().from(createTestConfig(url)).taggedMetricRegistry(registry).build();
OkHttpClients.create(clientConfiguration, AGENT, hostEventsSink, OkHttpClientsTest.class);
assertThat(Collections2.transform(registry.getMetrics().keySet(), MetricName::safeName)).contains("com.palantir.conjure.java.connection-pool.connections.idle", "com.palantir.conjure.java.connection-pool.connections.total", "com.palantir.conjure.java.dispatcher.calls.queued", "com.palantir.conjure.java.dispatcher.calls.running");
}
use of com.palantir.tritium.metrics.registry.MetricName in project conjure-java-runtime by palantir.
the class InstrumentedInterceptorTest method testResponseMetricRegistered.
@Test
public void testResponseMetricRegistered() throws IOException {
MetricName name = MetricName.builder().safeName("client.response").putSafeTags("service-name", "client").putSafeTags("libraryName", "conjure-java-runtime").putSafeTags("libraryVersion", "unknown").build();
Timer timer = registry.timer(name);
assertThat(timer.getCount()).isZero();
successfulRequest(REQUEST_A);
interceptor.intercept(chain);
assertThat(timer.getCount()).isEqualTo(1);
}
Aggregations