/** * It appears latency is reported in micros. * Using {@link Recorder} to support concurrent updates to histogram. */ public void measure(int latencyInMicros) { histogram.recordValue(latencyInMicros); }
@Override public void update(long value) { recorder.recordValue(value); }
@Override public void update(long value) { recorder.recordValue(value); }
private synchronized void recordSafeValue(long batchAggregationTimeNano) { initializeRecorder(); _recorder.recordValue(batchAggregationTimeNano); }
private synchronized void recordSafeValue(int batchSize) { initializeRecorder(); _recorder.recordValue(batchSize); }
@Override public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { if (!include(host, statement, exception)) return; long latencyMs = NANOSECONDS.toMillis(newLatencyNanos); try { Recorder recorder = getRecorder(host, statement, exception); if (recorder != null) recorder.recordValue(latencyMs); } catch (ArrayIndexOutOfBoundsException e) { logger.warn( "Got request with latency of {} ms, which exceeds the configured maximum trackable value {}", latencyMs, highestTrackableLatencyMillis); } }
public Flux<Payload> startPingPong(int count, final Recorder histogram) { return client .flatMapMany( rsocket -> Flux.range(1, count) .flatMap( i -> { long start = System.nanoTime(); return rsocket .requestResponse(payload.retain()) .doOnNext(Payload::release) .doFinally( signalType -> { long diff = System.nanoTime() - start; histogram.recordValue(diff); }); }, 64)) .doOnError(Throwable::printStackTrace); } }
@Override public void recordValue(long latencyNanos) { if (latencyNanos > HIGHEST_TRACKABLE_VALUE) { latencyNanos = HIGHEST_TRACKABLE_VALUE; } recorder.recordValue(latencyNanos); }
@Override public void update(long value) { recorder.recordValue(value); }
@Override public void update(long value) { recorder.recordValue(value); }
public void recordTopicLoadTimeValue(long topicLoadLatencyMs) { topicLoadTimeRecorder.recordValue(topicLoadLatencyMs); } }
@Override public void update(long value) { recorder.recordValue(value < this.highestTrackableValue ? value : this.highestTrackableValue); }
@Override public void update(long value) { recorder.recordValue(value); }
@Override public void update(long value) { recorder.recordValue(value); }
@Override public void update(long value) { try { recorder.recordValue(value / 1000); } catch (ArrayIndexOutOfBoundsException e) { LOG.warn("[{}] Recorded value ({}) is out of bounds, discarding", logPrefix, value); } }
@OnWebSocketMessage public void onMessage(String msg) throws JsonParseException { JsonObject json = new Gson().fromJson(msg, JsonObject.class); long endTimeNs = System.nanoTime(); long startTime = endTimeNs; if (startTimeMap.get(json.get(CONTEXT).getAsString()) != null) { startTime = startTimeMap.get(json.get(CONTEXT).getAsString()); } long latencyNs = endTimeNs - startTime; recorder.recordValue(NANOSECONDS.toMicros(latencyNs)); }
private synchronized void recordSafeValue(long batchAggregationTimeNano) { initializeRecorder(); _recorder.recordValue(batchAggregationTimeNano); }
@Override public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { if (!include(host, statement, exception)) return; long latencyMs = NANOSECONDS.toMillis(newLatencyNanos); try { Recorder recorder = getRecorder(host, statement, exception); if (recorder != null) recorder.recordValue(latencyMs); } catch (ArrayIndexOutOfBoundsException e) { logger.warn("Got request with latency of {} ms, which exceeds the configured maximum trackable value {}", latencyMs, highestTrackableLatencyMillis); } }
@Override public void update(Host host, Statement statement, Exception exception, long newLatencyNanos) { if (!include(host, statement, exception)) return; long latencyMs = NANOSECONDS.toMillis(newLatencyNanos); try { Recorder recorder = getRecorder(host, statement, exception); if (recorder != null) recorder.recordValue(latencyMs); } catch (ArrayIndexOutOfBoundsException e) { logger.warn("Got request with latency of {} ms, which exceeds the configured maximum trackable value {}", latencyMs, highestTrackableLatencyMillis); } }
public Flux<Payload> startPingPong(int count, final Recorder histogram) { connect(); return Flux.range(1, count) .flatMap(i -> { long start = System.nanoTime(); return reactiveSocket.requestResponse(payload) .doFinally(signalType -> { long diff = System.nanoTime() - start; histogram.recordValue(diff); }); }) .doOnError(Throwable::printStackTrace); } }