com.codahale.metrics.Histogram.update()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中com.codahale.metrics.Histogram.update()方法的一些代码示例,展示了Histogram.update()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.update()方法的具体详情如下:
包路径:com.codahale.metrics.Histogram
类名称:Histogram
方法名:update

Histogram.update介绍

[英]Adds a recorded value.
[中]添加记录的值。

代码示例

代码示例来源:origin: apache/flink

@Override
public void update(long value) {
  dropwizardHistogram.update(value);
}

代码示例来源:origin: apache/hbase

public void updateDelayInterval(long interval) {
  this.delayIntevalHist.update(interval);
 }
}

代码示例来源:origin: spotify/helios

@Override
 public void jobsHistoryEventSize(final int count) {
  eventsInJobHistoryHist.update(count);
 }
}

代码示例来源:origin: apache/hbase

private void collectRow() {
 rowSizeBytes.update(curRowBytes);
 rowSizeCols.update(curRowCols);
 keyLen.update(curRowKeyLength);
 if (curRowBytes > maxRowBytes && prevCell != null) {
  biggestRow = CellUtil.cloneRow(prevCell);
  maxRowBytes = curRowBytes;
 }
 curRowBytes = 0;
 curRowCols = 0;
}

代码示例来源:origin: apache/kylin

@Override
  public void updateHistogram(String name, int amount) {
    if (histograms.containsKey(name)) {
      histograms.get(name).update(amount);
    }
  }
}

代码示例来源:origin: apache/kylin

@Override
public void updateHistogram(String name, long count) {
  try {
    histogramLock.lock();
    Histogram histogram = histograms.get(name);
    histogram.update(count);
  } catch (ExecutionException e) {
    throw new IllegalStateException("Error retrieving meter " + name + " from the metric registry ", e);
  } finally {
    histogramLock.unlock();
  }
}

代码示例来源:origin: apache/zookeeper

public void addDataPoint(long value) {
  counter.add(value);
  histogram.update(value);
}

代码示例来源:origin: alibaba/jstorm

public static void updateHistogramPoints(Histogram histogram, byte[] points, int len) {
  if (points != null && len > 0) {
    for (int i = 0; i < len; i++) {
      long pt = Bytes.toLong(points, i * Longs.BYTES, Longs.BYTES);
      histogram.update(pt);
    }
  }
}

代码示例来源:origin: apache/hbase

public void update(RegionLoadStats regionStatistics) {
  this.memstoreLoadHist.update(regionStatistics.getMemStoreLoad());
  this.heapOccupancyHist.update(regionStatistics.getHeapOccupancy());
 }
}

代码示例来源:origin: AxonFramework/AxonFramework

@Override
  public void reportIgnored() {
    processedDurationHistogram.update(clock.getTime() - start);
  }
};

代码示例来源:origin: apache/incubator-gobblin

@Override
public void update(long value) {
 super.update(value);
 if (this.parentHistogram.isPresent()) {
  this.parentHistogram.get().update(value);
 }
}

代码示例来源:origin: apache/storm

private HBMessage sendPulse(HBPulse pulse) {
  String id = pulse.get_id();
  byte[] details = pulse.get_details();
  LOG.debug("Saving Pulse for id [ {} ] data [ {} ].", id, details);
  meterSendPulseCount.mark();
  meterTotalReceivedSize.mark(details.length);
  histogramHeartbeatSize.update(details.length);
  heartbeats.put(id, details);
  return new HBMessage(HBServerMessageType.SEND_PULSE_RESPONSE, null);
}

代码示例来源:origin: apache/hbase

@Override
public void postSync(final long timeInNanos, final int handlerSyncs) {
 syncMeter.mark();
 syncHistogram.update(timeInNanos);
 syncCountHistogram.update(handlerSyncs);
}

代码示例来源:origin: Graylog2/graylog2-server

private void recordEsMetrics(JestResult jestResult, @Nullable TimeRange range) {
  esTotalSearchesCounter.inc();
  final long tookMs = tookMsFromSearchResult(jestResult);
  esRequestTimer.update(tookMs, TimeUnit.MILLISECONDS);
  if (range != null) {
    esTimeRangeHistogram.update(TimeRanges.toSeconds(range));
  }
}

代码示例来源:origin: apache/hbase

public void updateRpc(CallStats stats) {
 this.callTimer.update(stats.getCallTimeMs(), TimeUnit.MILLISECONDS);
 this.reqHist.update(stats.getRequestSizeBytes());
 this.respHist.update(stats.getResponseSizeBytes());
}

代码示例来源:origin: thinkaurelius/titan

private void recordSliceMetrics(StoreTransaction txh, List<Entry> row) {
  if (!txh.getConfiguration().hasGroupName())
    return;
  String p = txh.getConfiguration().getGroupName();
  final MetricManager mgr = MetricManager.INSTANCE;
  mgr.getCounter(p, metricsStoreName, M_GET_SLICE, M_ENTRIES_COUNT).inc(row.size());
  mgr.getHistogram(p, metricsStoreName, M_GET_SLICE, M_ENTRIES_HISTO).update(row.size());
}

代码示例来源:origin: apache/hbase

void updateValueSize(final int valueSize) {
 if (!isRandomValueSize()) return;
 this.valueSizeHistogram.update(valueSize);
}

代码示例来源:origin: JanusGraph/janusgraph

private void recordSliceMetrics(StoreTransaction txh, List<Entry> row) {
  if (!txh.getConfiguration().hasGroupName())
    return;
  String p = txh.getConfiguration().getGroupName();
  final MetricManager mgr = MetricManager.INSTANCE;
  mgr.getCounter(p, metricsStoreName, M_GET_SLICE, M_ENTRIES_COUNT).inc(row.size());
  mgr.getHistogram(p, metricsStoreName, M_GET_SLICE, M_ENTRIES_HISTO).update(row.size());
}

代码示例来源:origin: apache/hbase

/** Update call stats for non-critical-path methods */
private void updateRpcGeneric(MethodDescriptor method, CallStats stats) {
 final String methodName = method.getService().getName() + "_" + method.getName();
 getMetric(DRTN_BASE + methodName, rpcTimers, timerFactory)
   .update(stats.getCallTimeMs(), TimeUnit.MILLISECONDS);
 getMetric(REQ_BASE + methodName, rpcHistograms, histogramFactory)
   .update(stats.getRequestSizeBytes());
 getMetric(RESP_BASE + methodName, rpcHistograms, histogramFactory)
   .update(stats.getResponseSizeBytes());
}

代码示例来源:origin: apache/hbase

public void collect(Cell cell) {
 valLen.update(cell.getValueLength());
 if (prevCell != null &&
   CellComparator.getInstance().compareRows(prevCell, cell) != 0) {
  // new row
  collectRow();
 }
 curRowBytes += cell.getSerializedSize();
 curRowKeyLength = KeyValueUtil.keyLength(cell);
 curRowCols++;
 prevCell = cell;
}

相关文章