public void addRequestResponseStats(long bytesSent, long numRequests, long bytesReceived, boolean isError, long sendRequestMs, long responseLatencyMs) { _requestsSent.inc(numRequests); _bytesSent.inc(bytesSent); _bytesReceived.inc(bytesReceived); if (isError) { _errors.inc(); } _sendRequestMsHistogram.update(sendRequestMs); _responseLatencyMsHistogram.update(responseLatencyMs); }
@Override public void run() { T resource = _resourceManager.create(_key); _histogram.update(System.currentTimeMillis() - startTime); if (null != resource) { callback.onSuccess(resource); } else { callback.onError(new Exception("Unable to create resource for key " + _key)); } } });
public void addServingStats(long requestSize, long responseSize, long numRequests, boolean error, long processingLatencyMs, long sendResponseLatencyMs) { _requestsReceived.inc(numRequests); _bytesReceived.inc(requestSize); _bytesSent.inc(responseSize); if (error) { _errors.inc(); } _sendResponseMsHistogram.update(sendResponseLatencyMs); _processingLatencyMsHistogram.update(processingLatencyMs); }
@Override public void run() { while (true) { QueueEntry e = null; try { e = _queue.take(); } catch (InterruptedException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } if (e.isLast()) { break; } try { e.getFuture().getOne(); _endLastResponseTime = System.currentTimeMillis(); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } long timeDiff = System.currentTimeMillis() - e.getTimeSentMs(); _latencyHistogram.update(timeDiff); } } }
/** * Adds a recorded value. * * @param value the length of the value */ public void update(int value) { update((long) value); }
public void update(long i) { for(Histogram histo : all) { histo.update(i); } } }
protected final void updateHistogram(Histogram histogram, int value, boolean record) { /** * The JIT compiler should be smart enough to eliminate this code * when {@link SkipListCache.trackEncodingByteUsage} is false. */ if (AbstractPageCache.trackEncodingByteUsage && record) { histogram.update(value); } }
@Override public void doneTask(int runs) { runsPerTask.update(runs); } }
@Override public void update(final long value) { delegate.update(value); }
@Override public long size(@NotNull AgentDigest toWrite) { long size = toWrite.encodedSize(); accumulatorValueSizes.update(size); return size; }
public void evicted(final long t, boolean primary) { if (t > this.startTime) this.ageAtEviction.update(t - this.startTime); this.evictedBlockCount.incrementAndGet(); if (primary) { primaryEvictedBlockCount.incrementAndGet(); } }
private void update(long duration) { if (duration >= 0) { histogram.update(duration); meter.mark(); } }
@Override public void run() { while (!minion.shutdown.get()) { try { Thread.sleep(Minion.hostMetricUpdaterInterval); minion.activeTaskHistogram.update(minion.activeTaskKeys.size()); minion.diskFree.set(minion.rootDir.getFreeSpace()); } catch (Exception ex) { if (!(ex instanceof InterruptedException)) { log.warn("Exception during host metric update: " + ex, ex); } } } } }
@Override public void execute(Object callback) { parsePostingResponse(service.postPushData(currentAgentId, workUnitId, currentMillis, format, pushData)); if (timeSpentInQueue == null) { timeSpentInQueue = Metrics.newHistogram(new MetricName("buffer", "", "queue-time")); } // timestamps on PostPushDataResultTask are local system clock, not drift-corrected clock timeSpentInQueue.update(System.currentTimeMillis() - currentMillis); }
@Override public void processHistogram(MetricName name, Histogram histogram, ReadProcessorContext context) throws Exception { if (histogram instanceof WavefrontHistogram) { ((WavefrontHistogram) histogram).update(context.getValue()); } else { histogram.update(Math.round(context.getValue())); } }
@Override public void processHistogram(MetricName name, Histogram histogram, ReadProcessorContext context) throws Exception { if (histogram instanceof WavefrontHistogram) { ((WavefrontHistogram) histogram).update(context.getValue()); } else { histogram.update(Math.round(context.getValue())); } }
@Override public void execute(Object callback) { parsePostingResponse(service.postPushData(currentAgentId, workUnitId, currentMillis, format, pushData)); if (timeSpentInQueue == null) { timeSpentInQueue = Metrics.newHistogram(new MetricName("buffer", "", "queue-time")); } // timestamps on PostPushDataResultTask are local system clock, not drift-corrected clock timeSpentInQueue.update(System.currentTimeMillis() - currentMillis); }
@Override public void handleIndexingEvent(IndexingEvent evt) { if (evt instanceof IndexUpdatedEvent) { IndexingMetrics metrics = SenseiZoieSystemFactory.this.metricsMap.get(partitionId); IndexUpdatedEvent updateEvent = (IndexUpdatedEvent) evt; metrics.docsIndexedMetric.mark(updateEvent.getNumDocsIndexed()); metrics.docsLeftoverMetric.mark(updateEvent.getNumDocsLeftInQueue()); metrics.flushTimeHistogram.update(updateEvent.getEndIndexingTime() - updateEvent.getStartIndexingTime()); } } });