本文整理汇总了Java中com.yammer.metrics.core.Metric.processWith方法的典型用法代码示例。如果您正苦于以下问题:Java Metric.processWith方法的具体用法?Java Metric.processWith怎么用?Java Metric.processWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.yammer.metrics.core.Metric
的用法示例。
在下文中一共展示了Metric.processWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printRegularMetrics
import com.yammer.metrics.core.Metric; //导入方法依赖的package包/类
protected void printRegularMetrics(long epoch) {
for (Map.Entry<String, SortedMap<MetricName, Metric>> entry : getMetricsRegistry().groupedMetrics(predicate)
.entrySet()) {
for (Map.Entry<MetricName, Metric> subEntry : entry.getValue().entrySet()) {
final Metric metric = subEntry.getValue();
if (metric != null) {
try {
log.info("Trying to process " + entry.getKey());
metric.processWith(this, subEntry.getKey(), epoch);
} catch (Exception ignored) {
log.error("Error printing regular metrics:", ignored);
}
}
}
}
}
示例2: mirrorFrom
import com.yammer.metrics.core.Metric; //导入方法依赖的package包/类
public void mirrorFrom(final MetricsRegistry sourceMetrics,
final Predicate<String> metricFilter,
final Function<MetricName, MetricName> metricNameAdjuster) {
for (final Map.Entry<MetricName, Metric> entry : filter(sourceMetrics, metricFilter)) {
try {
final Metric metric = entry.getValue();
final MetricName metricName = entry.getKey();
metric.processWith(metricRegistry2MetricsFactoryBridge, metricNameAdjuster.apply(metricName), new Object());
} catch (final Exception e) {
log.error("Could not process metrics", e);
}
}
}
示例3: processWith
import com.yammer.metrics.core.Metric; //导入方法依赖的package包/类
@Override
public <T> void processWith(MetricProcessor<T> processor, MetricName name, T context) throws Exception {
for (Metric c : _counters)
c.processWith(processor, name, context);
}