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