本文整理汇总了Java中com.yammer.metrics.Metrics.newHistogram方法的典型用法代码示例。如果您正苦于以下问题:Java Metrics.newHistogram方法的具体用法?Java Metrics.newHistogram怎么用?Java Metrics.newHistogram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.yammer.metrics.Metrics
的用法示例。
在下文中一共展示了Metrics.newHistogram方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNewMetricsGroup
import com.yammer.metrics.Metrics; //导入方法依赖的package包/类
protected MetricsGroup createNewMetricsGroup(String scope) {
MetricName readRandomAccessName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Random Latency in \u00B5s", scope);
MetricName readStreamAccessName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Stream Latency in \u00B5s", scope);
MetricName writeAcccessName = new MetricName(ORG_APACHE_BLUR, HDFS, "Write Latency in \u00B5s", scope);
MetricName readRandomThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Random Throughput", scope);
MetricName readStreamThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Stream Throughput", scope);
MetricName readSeekName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Stream Seeks", scope);
MetricName writeThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Write Throughput", scope);
MetricName totalHdfsBlocks = new MetricName(ORG_APACHE_BLUR, HDFS, "Hdfs Blocks Total", scope);
MetricName localHdfsBlocks = new MetricName(ORG_APACHE_BLUR, HDFS, "Hdfs Blocks Local", scope);
Histogram readRandomAccess = Metrics.newHistogram(readRandomAccessName);
Histogram readStreamAccess = Metrics.newHistogram(readStreamAccessName);
Histogram writeAccess = Metrics.newHistogram(writeAcccessName);
Meter readRandomThroughput = Metrics.newMeter(readRandomThroughputName, "Read Random Bytes", TimeUnit.SECONDS);
Meter readStreamThroughput = Metrics.newMeter(readStreamThroughputName, "Read Stream Bytes", TimeUnit.SECONDS);
Meter readStreamSeek = Metrics.newMeter(readSeekName, "Read Stream Seeks", TimeUnit.SECONDS);
Meter writeThroughput = Metrics.newMeter(writeThroughputName, "Write Bytes", TimeUnit.SECONDS);
Counter totalHdfsBlock = Metrics.newCounter(totalHdfsBlocks);
Counter localHdfsBlock = Metrics.newCounter(localHdfsBlocks);
return new MetricsGroup(readRandomAccess, readStreamAccess, writeAccess, readRandomThroughput,
readStreamThroughput, readStreamSeek, writeThroughput, totalHdfsBlock, localHdfsBlock);
}
示例2: createColumnFamilyHistogram
import com.yammer.metrics.Metrics; //导入方法依赖的package包/类
/**
* Create a histogram-like interface that will register both a CF, keyspace and global level
* histogram and forward any updates to both
*/
protected ColumnFamilyHistogram createColumnFamilyHistogram(String name, Histogram keyspaceHistogram)
{
Histogram cfHistogram = Metrics.newHistogram(factory.createMetricName(name), true);
register(name, cfHistogram);
return new ColumnFamilyHistogram(cfHistogram, keyspaceHistogram, Metrics.newHistogram(globalNameFactory.createMetricName(name), true));
}
示例3: Benchmark
import com.yammer.metrics.Metrics; //导入方法依赖的package包/类
public Benchmark(Operation operation, int numberOfRun, int concurrentLevel) {
this.operation = operation;
this.concurrentLevel = concurrentLevel;
this.numberOfRun = numberOfRun;
this.barrier = new CyclicBarrier(concurrentLevel + 1);
this.histogram = Metrics.newHistogram(Benchmark.class,
"operation-histogram" + System.nanoTime());
}
示例4: Benchmark
import com.yammer.metrics.Metrics; //导入方法依赖的package包/类
public Benchmark(Operation operation, int numberOfRun, int concurrentLevel) {
this.operation = operation;
this.concurrentLevel = concurrentLevel;
this.numberOfRun = numberOfRun;
this.barrier = new CyclicBarrier(concurrentLevel + 1);
this.histogram = Metrics.newHistogram(Benchmark.class, "operation-histogram" + System.nanoTime());
}
示例5: newHistogram
import com.yammer.metrics.Metrics; //导入方法依赖的package包/类
/**
*
* Return an existing histogram if
* (a) A histogram already exist with the same metric name.
* Otherwise, creates a new meter and registers
*
* @param registry MetricsRegistry
* @param name metric name
* @param biased (true if uniform distribution, otherwise exponential weighted)
* @return histogram
*/
public static Histogram newHistogram(MetricsRegistry registry, MetricName name, boolean biased) {
if (registry != null) {
return registry.newHistogram(name, biased);
} else {
return Metrics.newHistogram(name, biased);
}
}