本文整理汇总了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);
}
示例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();
}
});
}
示例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);
}
}