本文整理了Java中com.yammer.metrics.core.Histogram.update()
方法的一些代码示例,展示了Histogram.update()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.update()
方法的具体详情如下:
包路径:com.yammer.metrics.core.Histogram
类名称:Histogram
方法名:update
[英]Adds a recorded value.
[中]添加记录的值。
代码示例来源:origin: apache/incubator-pinot
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);
}
代码示例来源:origin: apache/incubator-pinot
@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));
}
}
});
代码示例来源:origin: apache/incubator-pinot
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);
}
代码示例来源:origin: apache/incubator-pinot
@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);
}
}
}
代码示例来源:origin: com.yammer.metrics/metrics-core
/**
* Adds a recorded value.
*
* @param value the length of the value
*/
public void update(int value) {
update((long) value);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public void update(long i)
{
for(Histogram histo : all)
{
histo.update(i);
}
}
}
代码示例来源:origin: addthis/hydra
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);
}
}
代码示例来源:origin: co.paralleluniverse/quasar
@Override
public void doneTask(int runs) {
runsPerTask.update(runs);
}
}
代码示例来源:origin: io.netty/netty-metrics-yammer
@Override
public void update(final long value) {
delegate.update(value);
}
代码示例来源:origin: com.wavefront/proxy
@Override
public long size(@NotNull AgentDigest toWrite) {
long size = toWrite.encodedSize();
accumulatorValueSizes.update(size);
return size;
}
代码示例来源:origin: harbby/presto-connectors
private void collectRow() {
rowSizeBytes.update(curRowBytes);
rowSizeCols.update(curRowCols);
keyLen.update(curRowKeyLength);
if (curRowBytes > maxRowBytes && prevCell != null) {
biggestRow = prevCell.getRow();
maxRowBytes = curRowBytes;
}
curRowBytes = 0;
curRowCols = 0;
}
代码示例来源:origin: harbby/presto-connectors
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();
}
}
代码示例来源:origin: com.yammer.metrics/metrics-core
private void update(long duration) {
if (duration >= 0) {
histogram.update(duration);
meter.mark();
}
}
代码示例来源:origin: harbby/presto-connectors
public void update(ClientProtos.RegionLoadStats regionStatistics) {
this.memstoreLoadHist.update(regionStatistics.getMemstoreLoad());
this.heapOccupancyHist.update(regionStatistics.getHeapOccupancy());
}
}
代码示例来源:origin: addthis/hydra
@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);
}
}
}
}
}
代码示例来源:origin: com.wavefront/proxy
@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);
}
代码示例来源:origin: wavefrontHQ/java
@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()));
}
}
代码示例来源:origin: com.wavefront/proxy
@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()));
}
}
代码示例来源:origin: wavefrontHQ/java
@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);
}
代码示例来源:origin: com.senseidb/sensei-core
@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());
}
}
});
内容来源于网络,如有侵权,请联系作者删除!