本文整理汇总了Java中com.yammer.metrics.core.MetricsRegistry.newHistogram方法的典型用法代码示例。如果您正苦于以下问题:Java MetricsRegistry.newHistogram方法的具体用法?Java MetricsRegistry.newHistogram怎么用?Java MetricsRegistry.newHistogram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.yammer.metrics.core.MetricsRegistry
的用法示例。
在下文中一共展示了MetricsRegistry.newHistogram方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CallTracker
import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
private CallTracker(MetricsRegistry registry, String name, String subName, String scope) {
StringBuilder sb = new StringBuilder(CLIENT_SVC).append("_").append(name);
if (subName != null) {
sb.append("(").append(subName).append(")");
}
this.name = sb.toString();
this.callTimer = registry.newTimer(MetricsConnection.class, DRTN_BASE + this.name, scope);
this.reqHist = registry.newHistogram(MetricsConnection.class, REQ_BASE + this.name, scope);
this.respHist = registry.newHistogram(MetricsConnection.class, RESP_BASE + this.name, scope);
}
示例2: RegionStats
import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
public RegionStats(MetricsRegistry registry, String name) {
this.name = name;
this.memstoreLoadHist = registry.newHistogram(MetricsConnection.class,
MEMLOAD_BASE + this.name);
this.heapOccupancyHist = registry.newHistogram(MetricsConnection.class,
HEAP_BASE + this.name);
}
示例3: RunnerStats
import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
public RunnerStats(MetricsRegistry registry) {
this.normalRunners = registry.newCounter(MetricsConnection.class, "normalRunnersCount");
this.delayRunners = registry.newCounter(MetricsConnection.class, "delayRunnersCount");
this.delayIntevalHist = registry.newHistogram(MetricsConnection.class, "delayIntervalHist");
}
示例4: testReporterWithDetails
import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的package包/类
private void testReporterWithDetails(){
StoredDataPointReceiver dbank = new StoredDataPointReceiver();
assertEquals(0, dbank.addDataPoints.size());
Set<SignalFxReporter.MetricDetails> detailsToAdd = new HashSet<SignalFxReporter.MetricDetails>();
detailsToAdd.add(SignalFxReporter.MetricDetails.STD_DEV);
detailsToAdd.add(SignalFxReporter.MetricDetails.MEAN);
MetricsRegistry metricRegistery = new MetricsRegistry();
SignalFxReporter reporter = new SignalFxReporter.Builder(metricRegistery, new StaticAuthToken(""), "myserver")
.setDataPointReceiverFactory(new StaticDataPointReceiverFactory(dbank))
.setDetailsToAdd(
ImmutableSet.of(
SignalFxReporter.MetricDetails.COUNT,
SignalFxReporter.MetricDetails.MIN,
SignalFxReporter.MetricDetails.MAX
)
)
.setName("testReporter")
.setDefaultSourceName("defaultSource")
.useLocalTime(false)
.setOnSendErrorHandlerCollection(
Collections.<OnSendErrorHandler>singleton(new OnSendErrorHandler(){
public void handleError(MetricError error){
System.out.println("" + error.getMessage());
}
})
)
.setFilter(MetricPredicate.ALL)
.setRateUnit(TimeUnit.SECONDS)
.setDetailsToAdd(detailsToAdd)
.build();
final MetricMetadata metricMetadata = reporter.getMetricMetadata();
MetricName histogramName = new MetricName("group1", "type1", "histogram");
Histogram histogram = metricRegistery.newHistogram(histogramName, true);
histogram.update(10);
histogram.update(14);
histogram.update(7);
metricMetadata.forMetric(histogram)
.withMetricName("histogram")
.withSourceName("histogram_source")
.withMetricType(SignalFxProtocolBuffers.MetricType.GAUGE)
.withDimension("key", "value");
reporter.report();
assertEquals(2, dbank.addDataPoints.size());
}
示例5: newHistogram
import com.yammer.metrics.core.MetricsRegistry; //导入方法依赖的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);
}
}