use of reactor.netty.channel.MeterKey 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 reactor.netty.channel.MeterKey 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 reactor.netty.channel.MeterKey in project reactor-netty by reactor.
the class MicrometerHttpClientMetricsRecorder method recordResponseTime.
@Override
public void recordResponseTime(SocketAddress remoteAddress, String uri, String method, String status, Duration time) {
String address = Metrics.formatSocketAddress(remoteAddress);
MeterKey meterKey = new MeterKey(uri, address, method, status);
Timer responseTime = MapUtils.computeIfAbsent(responseTimeCache, meterKey, key -> filter(Timer.builder(name() + RESPONSE_TIME).description(RESPONSE_TIME_DESCRIPTION).tags(REMOTE_ADDRESS, address, URI, uri, METHOD, method, STATUS, status).register(REGISTRY)));
if (responseTime != null) {
responseTime.record(time);
}
}
use of reactor.netty.channel.MeterKey in project reactor-netty by reactor.
the class MicrometerHttpServerMetricsRecorder method recordDataSentTime.
@Override
public void recordDataSentTime(String uri, String method, String status, Duration time) {
MeterKey meterKey = new MeterKey(uri, null, method, status);
Timer dataSentTime = MapUtils.computeIfAbsent(dataSentTimeCache, meterKey, key -> filter(Timer.builder(name() + DATA_SENT_TIME).tags(HttpServerMeters.DataSentTimeTags.URI.getKey(), uri, HttpServerMeters.DataSentTimeTags.METHOD.getKey(), method, HttpServerMeters.DataSentTimeTags.STATUS.getKey(), status).register(REGISTRY)));
if (dataSentTime != null) {
dataSentTime.record(time);
}
}
use of reactor.netty.channel.MeterKey in project reactor-netty by reactor.
the class MicrometerHttpClientMetricsRecorder method recordDataReceivedTime.
@Override
public void recordDataReceivedTime(SocketAddress remoteAddress, String uri, String method, String status, Duration time) {
String address = Metrics.formatSocketAddress(remoteAddress);
MeterKey meterKey = new MeterKey(uri, address, method, status);
Timer dataReceivedTime = MapUtils.computeIfAbsent(dataReceivedTimeCache, meterKey, key -> filter(Timer.builder(name() + DATA_RECEIVED_TIME).tags(HttpClientMeters.DataReceivedTimeTags.REMOTE_ADDRESS.getKey(), address, HttpClientMeters.DataReceivedTimeTags.URI.getKey(), uri, HttpClientMeters.DataReceivedTimeTags.METHOD.getKey(), method, HttpClientMeters.DataReceivedTimeTags.STATUS.getKey(), status).register(REGISTRY)));
if (dataReceivedTime != null) {
dataReceivedTime.record(time);
}
}
Aggregations