use of io.micrometer.api.instrument.DistributionSummary in project reactor-netty by reactor.
the class MicrometerHttpMetricsRecorder method recordDataSent.
@Override
public void recordDataSent(SocketAddress remoteAddress, String uri, long bytes) {
String address = Metrics.formatSocketAddress(remoteAddress);
MeterKey meterKey = new MeterKey(uri, address, null, null);
DistributionSummary dataSent = MapUtils.computeIfAbsent(dataSentCache, meterKey, key -> filter(DistributionSummary.builder(name() + DATA_SENT).baseUnit(ChannelMeters.DATA_SENT.getBaseUnit()).tags(REMOTE_ADDRESS.getKey(), address, URI.getKey(), uri).register(REGISTRY)));
if (dataSent != null) {
dataSent.record(bytes);
}
}
use of io.micrometer.api.instrument.DistributionSummary in project reactor-netty by reactor.
the class MicrometerHttpMetricsRecorder method recordDataReceived.
@Override
public void recordDataReceived(SocketAddress remoteAddress, String uri, long bytes) {
String address = Metrics.formatSocketAddress(remoteAddress);
MeterKey meterKey = new MeterKey(uri, address, null, null);
DistributionSummary dataReceived = MapUtils.computeIfAbsent(dataReceivedCache, meterKey, key -> filter(DistributionSummary.builder(name() + DATA_RECEIVED).baseUnit(ChannelMeters.DATA_RECEIVED.getBaseUnit()).tags(REMOTE_ADDRESS.getKey(), address, URI.getKey(), uri).register(REGISTRY)));
if (dataReceived != null) {
dataReceived.record(bytes);
}
}
use of io.micrometer.api.instrument.DistributionSummary in project reactor-netty by reactor.
the class UdpMetricsTests method checkDistributionSummary.
private void checkDistributionSummary(String name, String[] tags) {
DistributionSummary summary = registry.find(name).tags(tags).summary();
assertThat(summary).isNotNull();
assertThat(summary.count()).isEqualTo(1);
assertThat(summary.totalAmount() >= 5).isTrue();
}
use of io.micrometer.api.instrument.DistributionSummary in project reactor-netty by reactor.
the class TcpMetricsTests method checkDistributionSummary.
void checkDistributionSummary(String name, String[] tags, long expectedCount, int expectedAmount, boolean exists) {
DistributionSummary summary = registry.find(name).tags(tags).summary();
if (exists) {
assertThat(summary).isNotNull();
assertThat(summary.count()).isEqualTo(expectedCount);
assertThat(summary.totalAmount() >= expectedAmount).isTrue();
} else {
assertThat(summary).isNull();
}
}
use of io.micrometer.api.instrument.DistributionSummary in project reactor-netty by reactor.
the class MicrometerChannelMetricsRecorder method recordDataSent.
@Override
public void recordDataSent(SocketAddress remoteAddress, long bytes) {
String address = reactor.netty.Metrics.formatSocketAddress(remoteAddress);
DistributionSummary ds = MapUtils.computeIfAbsent(dataSentCache, address, key -> filter(DistributionSummary.builder(name + DATA_SENT).baseUnit(ChannelMeters.DATA_SENT.getBaseUnit()).tags(ChannelMeters.ChannelMetersTags.URI.getKey(), protocol, ChannelMeters.ChannelMetersTags.REMOTE_ADDRESS.getKey(), address).register(REGISTRY)));
if (ds != null) {
ds.record(bytes);
}
}
Aggregations