@Test public void ignoresAdditionalCallsToOnRequestWithSameRequestId() { sink.onRequest(requestId); assertThat(metrics.counter("outstanding").getCount(), is(1L)); sink.onRequest(requestId); assertThat(metrics.counter("outstanding").getCount(), is(1L)); }
@Override public void onRequest(Object requestId) { Long previous = this.ongoingRequests.putIfAbsent(requestId, nanoClock.nanoTime()); if (previous == null) { this.outstandingRequests.inc(); this.requestsIncoming.mark(); } }
RequestStatsCollector implements RequestProgressListener { @Override public void onRequest(Object requestId) { Long previous = this.ongoingRequests.putIfAbsent(requestId, nanoClock.nanoTime()); if (previous == null) { this.outstandingRequests.inc(); this.requestsIncoming.mark(); } } }
RequestStatsCollector implements RequestProgressListener { @Override public void onRequest(Object requestId) { Long previous = this.ongoingRequests.putIfAbsent(requestId, nanoClock.nanoTime()); if (previous == null) { this.outstandingRequests.inc(); this.requestsIncoming.mark(); } } RequestStatsCollector(MetricRegistry metrics);   RequestStatsCollector(MetricRegistry metrics, NanoClock nanoClock); }
RequestStatsCollector implements RequestProgressListener { @Override public void onRequest(Object requestId) { Long previous = this.ongoingRequests.putIfAbsent(requestId, nanoClock.nanoTime()); if (previous == null) { this.outstandingRequests.inc(); this.requestsIncoming.mark(); } } RequestStatsCollector(MetricRegistry metrics);   RequestStatsCollector(MetricRegistry metrics, NanoClock nanoClock); @Override void onRequest(Object requestId); @Override void onComplete(Object requestId, int responseStatus); @Override void onTerminate(Object requestId); }
RequestStatsCollector implements RequestProgressListener { @Override public void onRequest(Object requestId) { Long previous = this.ongoingRequests.putIfAbsent(requestId, nanoClock.nanoTime()); if (previous == null) { this.outstandingRequests.inc(); this.requestsIncoming.mark(); } } RequestStatsCollector(MetricRegistry metrics);   RequestStatsCollector(MetricRegistry metrics, NanoClock nanoClock); @Override void onRequest(Object requestId); @Override void onComplete(Object requestId, int responseStatus); @Override void onTerminate(Object requestId);  }