com.yammer.metrics.core.Counter.inc()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(281)

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

Counter.inc介绍

[英]Increment the counter by one.
[中]将计数器增加1。

代码示例

代码示例来源:origin: lealone/Lealone

@Override
protected void onInitialRejection(Runnable task) {
  metrics.totalBlocked.inc();
  metrics.currentBlocked.inc();
}

代码示例来源: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

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/usergrid

/** Add a count object to this batcher */
public void add( Count count ) throws CounterProcessingUnavailableException {
  invocationCounter.inc();
  final TimerContext context = addTimer.time();
  if ( batchSize == 1 ) {
    getBatch().addSerial( count );
  }
  else {
    getBatch().add( count );
  }
  context.stop();
}

代码示例来源:origin: com.yammer.metrics/metrics-core

/**
 * Increment the counter by one.
 */
public void inc() {
  inc(1);
}

代码示例来源:origin: addthis/hydra

@Override
  public void onFailedCheck() {
    failedCheckCounter.inc();
  }
}

代码示例来源:origin: com.ning/metrics.eventtracker-http

public void offer(final HttpJob job)
{
  if (queue.offer(job)) {
    jobsEnqueued.inc();
  }
  else {
    jobsDropped.inc();
  }
}

代码示例来源:origin: com.yammer.metrics/metrics-core

@Override
  public void uncaughtException(Thread t, Throwable e) {
    counter.inc();
    LOGGER.error("Uncaught exception on thread {}", t, e);
  }
}

代码示例来源:origin: com.wavefront/proxy

public void addPoints(List<String> metricStrings) {
 pointsReceived.inc(metricStrings.size());
 synchronized (pointsMutex) {
  this.points.addAll(metricStrings);
 }
}

代码示例来源:origin: com.wavefront/proxy

@Override
public void reject(@NotNull String line, @Nullable String message) {
 blockedCounter.inc();
 rejectedCounter.inc();
 blockedItemsLogger.warning(line);
 if (message != null && blockedItemsLimiter != null && blockedItemsLimiter.tryAcquire()) {
  logger.info("[" + handle + "] blocked input: [" + message + "]");
 }
}

代码示例来源:origin: com.wavefront/proxy

@Override
public void reject(@Nullable T item, @Nullable String message) {
 blockedCounter.inc();
 rejectedCounter.inc();
 if (item != null) {
  blockedItemsLogger.warning(serializer.apply(item));
 }
 if (message != null && blockedItemsLimiter != null && blockedItemsLimiter.tryAcquire()) {
  logger.info("[" + handle + "] blocked input: [" + message + "]");
 }
}

代码示例来源:origin: addthis/hydra

public QueryEngineDirectory(DataTree tree, String dir) {
  super(tree);
  this.dir = dir;
  currentlyOpenEngines.inc();
  engineCreations.mark(); //Metric for total trees/engines initialized
}

代码示例来源:origin: com.wavefront/proxy

@Override
public void add(T t) {
 addCounter.inc();
 try {
  queueLock.lock();
  backingQueue.add(t);
 } finally {
  queueLock.unlock();
 }
}

代码示例来源:origin: com.wavefront/proxy

@Override
public T peek() {
 peekCounter.inc();
 T t;
 try {
  queueLock.lock();
  t = backingQueue.peek();
 } finally {
  queueLock.unlock();
 }
 return t;
}

代码示例来源:origin: addthis/hydra

public void queueQuery(MeshQueryMaster querySource, KVPairs kv, HttpRequest request,
    ChannelHandlerContext ctx) throws Exception {
  QueryRequest queryRequest = new QueryRequest(querySource, kv, request, ctx);
  // throws exception when queue is full - callers should handle appropriately
  blockingQueue.add(queryRequest);
  queueCount.inc();
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

@Override
  public void executeAsync()
  {
    makeDataRequests(targetReplicas.subList(0, targetReplicas.size() > 1 ? 2 : 1));
    if (targetReplicas.size() > 2)
      makeDigestRequests(targetReplicas.subList(2, targetReplicas.size()));
    cfs.metric.speculativeRetries.inc();
  }
}

代码示例来源:origin: com.wavefront/proxy

@Override
 public void processGauge(MetricName name, Gauge<?> gauge, FlushProcessorContext context) throws Exception {
  @SuppressWarnings("unchecked")
  ChangeableGauge<Double> changeableGauge = (ChangeableGauge<Double>) gauge;
  Double value = changeableGauge.value();
  if (value == null || value.isInfinite() || value.isNaN()) return;
  context.report(value);
  sentCounter.inc();
 }
}

代码示例来源:origin: addthis/hydra

private static boolean executeAndTimeInsert(PreparedStatement preparedStatement) throws SQLException {
  TimerContext timerContext = insertTimer.time();
  try {
    return preparedStatement.execute();
  } catch (SQLException e) {
    errorCounter.inc();
    throw e;
  } finally {
    timerContext.stop();
  }
}

代码示例来源:origin: addthis/hydra

private boolean close(OutputWrapper outputWrapper) {
  synchronized (this) {
    outputWrapper.close();
    openOutputs.remove(outputWrapper.getRawTarget());
    openOutputQueue.remove(outputWrapper.getRawTarget());
    closes.inc();
    return true;
  }
}

代码示例来源:origin: addthis/hydra

/**
 * Fail a host. For any tasks with replicas on that host, move these replicas elsewhere. For any tasks with live copies on the host,
 * promote a replica, then make a new replica somewhere else.
 */
private void markHostDead(String failedHostUuid) {
  if (failedHostUuid == null || !checkHostStatesForFailure(failedHostUuid)) {
    return;
  }
  spawn.markHostStateDead(failedHostUuid);
  hostFailState.removeHost(failedHostUuid);
  failHostCount.inc();
}

相关文章