Search in sources :

Example 6 with MeterKey

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);
    }
}
Also used : MeterKey(reactor.netty.channel.MeterKey) Timer(io.micrometer.api.instrument.Timer)

Example 7 with MeterKey

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();
    }
}
Also used : MeterKey(reactor.netty.channel.MeterKey) Counter(io.micrometer.api.instrument.Counter)

Example 8 with MeterKey

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);
    }
}
Also used : MeterKey(reactor.netty.channel.MeterKey) Timer(io.micrometer.api.instrument.Timer)

Example 9 with MeterKey

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);
    }
}
Also used : MeterKey(reactor.netty.channel.MeterKey) Timer(io.micrometer.api.instrument.Timer)

Aggregations

MeterKey (reactor.netty.channel.MeterKey)9 Timer (io.micrometer.api.instrument.Timer)6 DistributionSummary (io.micrometer.api.instrument.DistributionSummary)2 Counter (io.micrometer.api.instrument.Counter)1