Search in sources :

Example 1 with SimpleMeterRegistry

use of io.micrometer.api.instrument.simple.SimpleMeterRegistry in project reactor-netty by reactor.

the class PooledConnectionProviderDefaultMetricsTest method setUp.

@BeforeEach
void setUp() {
    registry = new SimpleMeterRegistry();
    Metrics.addRegistry(registry);
}
Also used : SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with SimpleMeterRegistry

use of io.micrometer.api.instrument.simple.SimpleMeterRegistry in project reactor-netty by reactor.

the class ByteBufAllocatorMetricsTest method setUp.

@BeforeEach
void setUp() {
    registry = new SimpleMeterRegistry();
    Metrics.addRegistry(registry);
}
Also used : SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with SimpleMeterRegistry

use of io.micrometer.api.instrument.simple.SimpleMeterRegistry in project reactor-netty by reactor.

the class TransportEventLoopMetricsTest method setUp.

@BeforeEach
void setUp() {
    registry = new SimpleMeterRegistry();
    Metrics.addRegistry(registry);
}
Also used : SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with SimpleMeterRegistry

use of io.micrometer.api.instrument.simple.SimpleMeterRegistry in project reactor-netty by reactor.

the class TcpMetricsTests method setUp.

@BeforeEach
void setUp() {
    tcpServer = customizeServerOptions(TcpServer.create().host("127.0.0.1").port(0).metrics(true));
    provider = ConnectionProvider.create("TcpMetricsTests", 1);
    tcpClient = customizeClientOptions(TcpClient.create(provider).remoteAddress(() -> disposableServer.address()).metrics(true));
    registry = new SimpleMeterRegistry();
    Metrics.addRegistry(registry);
}
Also used : SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with SimpleMeterRegistry

use of io.micrometer.api.instrument.simple.SimpleMeterRegistry in project reactor-netty by reactor.

the class HttpMetricsHandlerTests method setUp.

/**
 * Initialization done before running each test.
 * <ul>
 *  <li> /1 is used by testExistingEndpoint test</li>
 *  <li> /2 is used by testExistingEndpoint, and testUriTagValueFunctionNotSharedForClient tests</li>
 *  <li> /3 does not exists but is used by testNonExistingEndpoint, checkExpectationsNonExisting tests</li>
 *  <li> /4 is used by testServerConnectionsMicrometer test</li>
 *  <li> /5 is used by testServerConnectionsRecorder test</li>
 * </ul>
 */
@BeforeEach
void setUp() {
    httpServer = createServer().host("127.0.0.1").metrics(true, Function.identity()).route(r -> r.post("/1", (req, res) -> res.header("Connection", "close").send(req.receive().retain().delayElements(Duration.ofMillis(10)))).post("/2", (req, res) -> res.header("Connection", "close").send(req.receive().retain().delayElements(Duration.ofMillis(10)))).post("/4", (req, res) -> res.header("Connection", "close").send(req.receive().retain().doOnNext(b -> checkServerConnectionsMicrometer(req.hostAddress())))).post("/5", (req, res) -> res.header("Connection", "close").send(req.receive().retain().doOnNext(b -> checkServerConnectionsRecorder(req.hostAddress())))));
    provider = ConnectionProvider.create("HttpMetricsHandlerTests", 1);
    httpClient = createClient(provider, () -> disposableServer.address()).metrics(true, Function.identity());
    registry = new SimpleMeterRegistry();
    Metrics.addRegistry(registry);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) StepVerifier(reactor.test.StepVerifier) SocketAddress(java.net.SocketAddress) ContextView(reactor.util.context.ContextView) ContextAwareHttpServerMetricsRecorder(reactor.netty.http.server.ContextAwareHttpServerMetricsRecorder) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseHttpTest(reactor.netty.BaseHttpTest) DATA_SENT_TIME(reactor.netty.Metrics.DATA_SENT_TIME) Counter(io.micrometer.api.instrument.Counter) Tags(io.micrometer.api.instrument.Tags) ProtocolSslContextSpec(reactor.netty.tcp.SslProvider.ProtocolSslContextSpec) BeforeAll(org.junit.jupiter.api.BeforeAll) ByteBufFlux(reactor.netty.ByteBufFlux) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) MethodSource(org.junit.jupiter.params.provider.MethodSource) Timer(io.micrometer.api.instrument.Timer) ERRORS(reactor.netty.Metrics.ERRORS) RESPONSE_TIME(reactor.netty.Metrics.RESPONSE_TIME) Context(reactor.util.context.Context) TLS_HANDSHAKE_TIME(reactor.netty.Metrics.TLS_HANDSHAKE_TIME) MeterRegistryAssert(io.micrometer.core.tck.MeterRegistryAssert) Arguments(org.junit.jupiter.params.provider.Arguments) InetSocketAddress(java.net.InetSocketAddress) DistributionSummary(io.micrometer.api.instrument.DistributionSummary) HTTP_CLIENT_PREFIX(reactor.netty.Metrics.HTTP_CLIENT_PREFIX) Test(org.junit.jupiter.api.Test) STATUS(reactor.netty.Metrics.STATUS) ContextAwareHttpClientMetricsRecorder(reactor.netty.http.client.ContextAwareHttpClientMetricsRecorder) CountDownLatch(java.util.concurrent.CountDownLatch) HttpServer(reactor.netty.http.server.HttpServer) Stream(java.util.stream.Stream) Named(org.junit.jupiter.api.Named) CONNECT_TIME(reactor.netty.Metrics.CONNECT_TIME) Gauge(io.micrometer.api.instrument.Gauge) HttpClient(reactor.netty.http.client.HttpClient) SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) REMOTE_ADDRESS(reactor.netty.Metrics.REMOTE_ADDRESS) HTTP_SERVER_PREFIX(reactor.netty.Metrics.HTTP_SERVER_PREFIX) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Nullable(reactor.util.annotation.Nullable) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) InsecureTrustManagerFactory(io.netty.handler.ssl.util.InsecureTrustManagerFactory) ByteBuf(io.netty.buffer.ByteBuf) DATA_SENT(reactor.netty.Metrics.DATA_SENT) METHOD(reactor.netty.Metrics.METHOD) DATA_RECEIVED_TIME(reactor.netty.Metrics.DATA_RECEIVED_TIME) Metrics.formatSocketAddress(reactor.netty.Metrics.formatSocketAddress) CONNECTIONS_ACTIVE(reactor.netty.Metrics.CONNECTIONS_ACTIVE) CONNECTIONS_TOTAL(reactor.netty.Metrics.CONNECTIONS_TOTAL) SelfSignedCertificate(io.netty.handler.ssl.util.SelfSignedCertificate) HttpServerMetricsRecorder(reactor.netty.http.server.HttpServerMetricsRecorder) Mono(reactor.core.publisher.Mono) CertificateException(java.security.cert.CertificateException) LOCAL_ADDRESS(reactor.netty.Metrics.LOCAL_ADDRESS) TimeUnit(java.util.concurrent.TimeUnit) Flux(reactor.core.publisher.Flux) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) SslProvider(io.netty.handler.ssl.SslProvider) MeterRegistry(io.micrometer.api.instrument.MeterRegistry) Metrics(io.micrometer.api.instrument.Metrics) DATA_RECEIVED(reactor.netty.Metrics.DATA_RECEIVED) ConnectionProvider(reactor.netty.resources.ConnectionProvider) URI(reactor.netty.Metrics.URI) SimpleMeterRegistry(io.micrometer.api.instrument.simple.SimpleMeterRegistry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

SimpleMeterRegistry (io.micrometer.api.instrument.simple.SimpleMeterRegistry)7 BeforeEach (org.junit.jupiter.api.BeforeEach)7 Counter (io.micrometer.api.instrument.Counter)1 DistributionSummary (io.micrometer.api.instrument.DistributionSummary)1 Gauge (io.micrometer.api.instrument.Gauge)1 MeterRegistry (io.micrometer.api.instrument.MeterRegistry)1 Metrics (io.micrometer.api.instrument.Metrics)1 Tags (io.micrometer.api.instrument.Tags)1 Timer (io.micrometer.api.instrument.Timer)1 MeterRegistryAssert (io.micrometer.core.tck.MeterRegistryAssert)1 ByteBuf (io.netty.buffer.ByteBuf)1 SslProvider (io.netty.handler.ssl.SslProvider)1 InsecureTrustManagerFactory (io.netty.handler.ssl.util.InsecureTrustManagerFactory)1 SelfSignedCertificate (io.netty.handler.ssl.util.SelfSignedCertificate)1 InetSocketAddress (java.net.InetSocketAddress)1 SocketAddress (java.net.SocketAddress)1 CertificateException (java.security.cert.CertificateException)1 Duration (java.time.Duration)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 TimeUnit (java.util.concurrent.TimeUnit)1