Search in sources :

Example 6 with DistributionSummary

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

the class MicrometerChannelMetricsRecorder method recordDataReceived.

@Override
public void recordDataReceived(SocketAddress remoteAddress, long bytes) {
    String address = reactor.netty.Metrics.formatSocketAddress(remoteAddress);
    DistributionSummary ds = MapUtils.computeIfAbsent(dataReceivedCache, address, key -> filter(DistributionSummary.builder(name + DATA_RECEIVED).baseUnit(ChannelMeters.DATA_RECEIVED.getBaseUnit()).tags(ChannelMeters.ChannelMetersTags.URI.getKey(), protocol, ChannelMeters.ChannelMetersTags.REMOTE_ADDRESS.getKey(), address).register(REGISTRY)));
    if (ds != null) {
        ds.record(bytes);
    }
}
Also used : DistributionSummary(io.micrometer.api.instrument.DistributionSummary)

Example 7 with DistributionSummary

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

the class HttpMetricsHandlerTests method checkDistributionSummary.

private void checkDistributionSummary(String name, String[] tags, long expectedCount, double expectedAmount) {
    DistributionSummary summary = registry.find(name).tags(tags).summary();
    assertThat(summary).isNotNull();
    assertThat(summary.count()).isEqualTo(expectedCount);
    assertThat(summary.totalAmount() >= expectedAmount).isTrue();
}
Also used : DistributionSummary(io.micrometer.api.instrument.DistributionSummary)

Aggregations

DistributionSummary (io.micrometer.api.instrument.DistributionSummary)7 MeterKey (reactor.netty.channel.MeterKey)2