当前位置: 首页>>代码示例>>Java>>正文


Java MetricsRegistry.newMeter方法代码示例

本文整理汇总了Java中com.yammer.metrics.core.MetricsRegistry.newMeter方法的典型用法代码示例。如果您正苦于以下问题:Java MetricsRegistry.newMeter方法的具体用法?Java MetricsRegistry.newMeter怎么用?Java MetricsRegistry.newMeter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.yammer.metrics.core.MetricsRegistry的用法示例。


在下文中一共展示了MetricsRegistry.newMeter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ParamMeter

import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
public ParamMeter(final MetricsRegistry registry, final ParamMetricName paramMetricName,
                  final String eventType, final TimeUnit timeUnit) {
  this.registry = checkNotNull(registry);
  this.paramMetricName = checkNotNull(paramMetricName);
  this.eventType = checkNotNull(eventType);
  this.timeUnit = checkNotNull(timeUnit);

  this.total = registry.newMeter(paramMetricName.getTotal(), eventType, timeUnit);
}
 
开发者ID:spotify,项目名称:metrics-munin-reporter,代码行数:10,代码来源:ParamMeter.java

示例2: YammerMetrics

import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
public YammerMetrics(final MetricsRegistry registry) {
  this.gets = registry.newTimer(name("get", "requests"), SECONDS, SECONDS);
  this.getSuccesses = registry.newMeter(name("get", "successes"), "Successes", SECONDS);
  this.getHits = registry.newMeter(name("get", "hits"), "Hits", SECONDS);
  this.getMisses = registry.newMeter(name("get", "misses"), "Misses", SECONDS);
  this.getFailures = registry.newMeter(name("get", "failures"), "Failures", SECONDS);

  this.multigets = registry.newTimer(name("multiget", "requests"), SECONDS, SECONDS);
  this.multigetSuccesses = registry.newMeter(name("multiget", "successes"), "Successes", SECONDS);
  this.multigetFailures = registry.newMeter(name("multiget", "failures"), "Failures", SECONDS);

  this.sets = registry.newTimer(name("set", "requests"), SECONDS, SECONDS);
  this.setSuccesses = registry.newMeter(name("set", "successes"), "Successes", SECONDS);
  this.setFailures = registry.newMeter(name("set", "failures"), "Failures", SECONDS);

  this.deletes = registry.newTimer(name("delete", "requests"), SECONDS, SECONDS);
  this.deleteSuccesses = registry.newMeter(name("delete", "successes"), "Successes", SECONDS);
  this.deleteFailures = registry.newMeter(name("delete", "failures"), "Failures", SECONDS);

  this.incrDecrs = registry.newTimer(name("incrdecr", "requests"), SECONDS, SECONDS);
  this.incrDecrSuccesses = registry.newMeter(name("incrdecr", "successes"), "Successes", SECONDS);
  this.incrDecrFailures = registry.newMeter(name("incrdecr", "failures"), "Failures", SECONDS);

  this.touches = registry.newTimer(name("touch", "requests"), SECONDS, SECONDS);
  this.touchSuccesses = registry.newMeter(name("touch", "successes"), "Successes", SECONDS);
  this.touchFailures = registry.newMeter(name("touch", "failures"), "Failures", SECONDS);

  final MetricName gaugeName = name("outstandingRequests", "count");
  this.outstandingRequestsGauge = registry.newGauge(gaugeName, new Gauge<Integer>() {
    @Override
    public Integer value() {
      return internalOutstandingReqGauge != null ?
             internalOutstandingReqGauge.getOutstandingRequests() : 0;
    }
  });

  final MetricName globalConnections = name("global-connections", "count");
  registry.newGauge(globalConnections, new Gauge<Integer>() {
    @Override
    public Integer value() {
      return Utils.getGlobalConnectionCount();
    }
  });
}
 
开发者ID:spotify,项目名称:folsom,代码行数:45,代码来源:YammerMetrics.java

示例3: newMeter

import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
/**
 *
 * Return an existing meter if
 *  (a) A meter already exist with the same metric name.
 * Otherwise, creates a new meter and registers
 *
 * @param registry MetricsRegistry
 * @param name metric name
 * @param eventType Event Type
 * @param unit TimeUnit for rate determination
 * @return Meter
 */
public static Meter newMeter(MetricsRegistry registry, MetricName name, String eventType, TimeUnit unit) {
  if (registry != null) {
    return registry.newMeter(name, eventType, unit);
  } else {
    return Metrics.newMeter(name, eventType, unit);
  }
}
 
开发者ID:Hanmourang,项目名称:Pinot,代码行数:20,代码来源:MetricsHelper.java


注:本文中的com.yammer.metrics.core.MetricsRegistry.newMeter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。