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

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

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

Counter.clear介绍

[英]Resets the counter to 0.
[中]将计数器重置为0。

代码示例

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

@Override
public void onPassedCheck() {
  if (resetOnSuccess) {
    failedCheckCounter.clear();
  }
}

代码示例来源:origin: io.netty/netty-metrics-yammer

@Override
public void reset() {
  delegate.clear();
}

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

public class Counter {
   static Counter counter1 = new Counter();
   ...
   public void resetCounters() {
    counter1.clear();
    counter2.clear();
    ...
   }
  }

代码示例来源:origin: com.senseidb/sensei-core

@Override
public void clusterChanged(Map<Integer, List<InetSocketAddress>> clusterView) {
 logger.info("clusterChanged(): Received new clusterView from zu " + clusterView);
 Set<InetSocketAddress> nodeAddresses = getNodesAddresses(clusterView);
 synchronized (SenseiBroker.class) {
  numberOfNodesInTheCluster.clear();
  numberOfNodesInTheCluster.inc(nodeAddresses.size());
 }
}

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

@Override
public boolean quiesceCluster(boolean quiesce, String username) {
  int desiredQuiescentLevel;
  if (quiesce) {
    desiredQuiescentLevel = 100;
  } else {
    desiredQuiescentLevel = 0;
  }
  if (spawn.spawnState.quiescentLevel.compareAndSet(100 - desiredQuiescentLevel, desiredQuiescentLevel)) {
    SpawnMetrics.quiesceCount.clear();
    if (quiesce) {
      SpawnMetrics.quiesceCount.inc();
    }
    spawn.writeState();
    spawn.sendClusterQuiesceEvent(username);
    log.info("User {} has {} the cluster.", username, (quiesce ? "quiesced" : "unquiesed"));
  }
  return isQuiesced();
}

代码示例来源:origin: com.senseidb/sensei-core

synchronized (deletedIndexes) {
 count = uidToArrayIndex.size() + deletedIndexes.size();
 currentDocumentsCounter.clear();
 currentDocumentsCounter.inc(uidToArrayIndex.size());
 reclaimedDocumentsCounter.clear();
 reclaimedDocumentsCounter.inc(deletedIndexes.size());
 logger.info("Flush compositeActivityValues. Documents = " + uidToArrayIndex.size()

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

((Counter) metric).dec((long) value * -1);
} else {
  ((Counter) metric).clear();

代码示例来源:origin: com.senseidb/sensei-core

@Override
 public void run() {
  int totalDocs = 0;
  try {
   SenseiRequest req = new SenseiRequest();
   req.setQuery(new SenseiJSONQuery(new FastJSONObject().put("query", "dummy:dummy")));
   SenseiResult res = _senseiBroker.browse(req);
   totalDocs = res.getTotalDocs();
  } catch (Exception e) {
   logger.warn("Error getting result", e);
  }
  if (totalDocs > 0) {
   totalDocsCounter.clear();
   totalDocsCounter.inc(totalDocs);
  } else {
   logger.warn("Unable to get total docs");
  }
  try {
   SenseiSystemInfo sysInfo = _senseiSysBroker.browse(new SenseiRequest());
   if (sysInfo != null && sysInfo.getFacetInfos() != null) {
    _facetInfoMap = extractFacetInfo(sysInfo);
    _compiler.setFacetInfoMap(_facetInfoMap);
   }
  } catch (Exception e) {
   logger.info("Hit exception trying to get sysinfo", e);
  }
 }
}, 300000, 300000); // Every 5 minutes.

相关文章