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

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

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

Counter.count介绍

[英]Returns the counter's current value.
[中]返回计数器的当前值。

代码示例

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

@Override
public long getTotalRequests() {
 return _requestsReceived.count();
}

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

@Override
public long getTotalBytesReceived() {
 return _bytesReceived.count();
}

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

@Override
public long getTotalErrors() {
 return _errors.count();
}

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

@Override
public long getTotalRequests() {
 return _requestsSent.count();
}

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

@Override
public long getTotalBytesSent() {
 return _bytesSent.count();
}

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

@Override
public long getTotalBytesReceived() {
 return _bytesReceived.count();
}

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

@Override
public long getTotalErrors() {
 return _errors.count();
}

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

@Override
public long getTotalBytesSent() {
 return _bytesSent.count();
}

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

public int getTotalBlockedTasks() {
  return (int) metrics.totalBlocked.count();
}

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

public int getCurrentlyBlockedTasks() {
  return (int) metrics.currentBlocked.count();
}

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

@Override
public String toString() {
 return "NettyServerMetric [_requestsReceived=" + _requestsReceived.count() + ", _bytesSent=" + _bytesSent.count()
   + ", _bytesReceived=" + _bytesReceived.count() + ", _errors=" + _errors.count() + ", _sendResponseMsGauge="
   + _sendResponseMsHistogram.count() + ", _processingLatencyMsGauge=" + _processingLatencyMsHistogram.count()
   + "]";
}

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

@Override
public String toString() {
 return "NettyClientMetric [_requestsSent=" + _requestsSent.count() + ", _bytesSent=" + _bytesSent.count()
   + ", _bytesReceived=" + _bytesReceived.count() + ", _errors=" + _errors.count() + ", _sendRequestMsGauge="
   + _sendRequestMsHistogram.count() + ", _responseLatencyMsGauge=" + _responseLatencyMsHistogram.count()
   + ", _connectMsGauge=" + _connectMsGauge.value() + "]";
}

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

/**
  * Update counter from underlying counters.
  */
 public void refresh() {
  long count = 0;
  for (Metric m : _counters) {
   if (m instanceof Counter) {
    count += ((Counter) m).count();
   } else if (m instanceof AggregatedCounter) {
    count += ((AggregatedCounter) m).count();
   }
  }
  _count = count;
 }
}

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

final long startCount = batcher.invocationCounter.count();
final long currentCount = batcher.invocationCounter.count();

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

@Override
  public long getCount() {
    return metric.count();
  }
}

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

private String populateToString(MoreObjects.ToStringHelper helper) {
  return helper.add("reading", reading.count())
         .add("opening", opening.count())
         .add("unseen", openNew.count())
         .add("continued", openIndex.count())
         .add("skipping", skipping.count())
         .add("skipped", openSkip.count())
         .add("bundles-skipped", globalBundleSkip.count())
         .add("median-size", fileSizeHisto.getSnapshot().getMedian())
         .toString();
}

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

@Override
public void processCounter(MetricName name, Counter counter, Context context) throws IOException {
  final PrintStream stream = context.getStream("# time,count");
  stream.println(counter.count());
  stream.flush();
}

代码示例来源:origin: stackoverflow.com

public class Counter {

 ... existing members ...

 public static void main(String[] args) {
  int initialValue = Integer.parseInt(args[0]);
  Counter tally = new Counter(initialValue);
  tally.count();
 }
}

代码示例来源:origin: org.rhq/rhq-enterprise-server

@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public long getWriteRequestTimeouts() {
  return driverMetrics.getErrorMetrics().getWriteTimeouts().count();
}

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

@Test
public void reportsCounterValues() throws Exception {
  final Counter counter = mock(Counter.class);
  when(counter.count()).thenReturn(100L);
  reporter.processCounter(name("counter"), counter, null);
  verify(output).send(decode("name = t.test.counter, value = 100, group = counter, units = \"\""));
}

相关文章