本文整理汇总了Java中io.micrometer.core.instrument.histogram.HistogramConfig.getHistogramBuckets方法的典型用法代码示例。如果您正苦于以下问题:Java HistogramConfig.getHistogramBuckets方法的具体用法?Java HistogramConfig.getHistogramBuckets怎么用?Java HistogramConfig.getHistogramBuckets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.micrometer.core.instrument.histogram.HistogramConfig
的用法示例。
在下文中一共展示了HistogramConfig.getHistogramBuckets方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newTimer
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected Timer newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector) {
DropwizardTimer timer = new DropwizardTimer(id, registry.timer(hierarchicalName(id)), clock, histogramConfig, pauseDetector);
for (double percentile : histogramConfig.getPercentiles()) {
String formattedPercentile = DoubleFormat.toString(percentile * 100) + "percentile";
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", formattedPercentile),
timer, t -> t.percentile(percentile, getBaseTimeUnit()));
}
if (histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(getConventionName(id), Tags.concat(getConventionTags(id), "bucket", Long.toString(bucket)),
timer, t -> t.histogramCountAtValue(bucket));
}
}
return timer;
}
示例2: newDistributionSummary
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected DistributionSummary newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig) {
DropwizardDistributionSummary summary = new DropwizardDistributionSummary(id, clock, registry.histogram(hierarchicalName(id)), histogramConfig);
for (double percentile : histogramConfig.getPercentiles()) {
String formattedPercentile = DoubleFormat.toString(percentile * 100) + "percentile";
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", formattedPercentile),
summary, s -> summary.percentile(percentile));
}
if (histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(getConventionName(id), Tags.concat(getConventionTags(id), "bucket", Long.toString(bucket)),
summary, s -> s.histogramCountAtValue(bucket));
}
}
return summary;
}
示例3: newDistributionSummary
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected DistributionSummary newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig) {
HistogramConfig merged = histogramConfig.merge(HistogramConfig.builder()
.histogramExpiry(config.step())
.build());
DistributionSummary summary;
switch (config.mode()) {
case Cumulative:
summary = new CumulativeDistributionSummary(id, clock, merged);
break;
case Step:
default:
summary = new StepDistributionSummary(id, clock, merged);
break;
}
for (double percentile : histogramConfig.getPercentiles()) {
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", percentileFormat.format(percentile)),
summary, s -> summary.percentile(percentile));
}
if(histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(getConventionName(id), Tags.concat(getConventionTags(id), "bucket", Long.toString(bucket)),
summary, s -> s.histogramCountAtValue(bucket));
}
}
return summary;
}
示例4: newTimer
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected Timer newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector) {
HistogramConfig merged = histogramConfig.merge(HistogramConfig.builder()
.histogramExpiry(config.step())
.build());
Timer timer;
switch (config.mode()) {
case Cumulative:
timer = new CumulativeTimer(id, clock, merged, pauseDetector, getBaseTimeUnit());
break;
case Step:
default:
timer = new StepTimer(id, clock, merged, pauseDetector, getBaseTimeUnit());
break;
}
for (double percentile : histogramConfig.getPercentiles()) {
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", percentileFormat.format(percentile)),
timer, t -> t.percentile(percentile, getBaseTimeUnit()));
}
if(histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(getConventionName(id), Tags.concat(getConventionTags(id), "bucket",
percentileFormat.format(TimeUtils.nanosToUnit(bucket, getBaseTimeUnit()))),
timer, t -> t.histogramCountAtValue(bucket));
}
}
return timer;
}
示例5: newTimer
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected Timer newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector) {
Timer timer = new StatsdTimer(id, lineBuilder(id), publisher, clock, histogramConfig, pauseDetector, getBaseTimeUnit(),
statsdConfig.step().toMillis());
for (double percentile : histogramConfig.getPercentiles()) {
switch (statsdConfig.flavor()) {
case Datadog:
gauge(id.getName() + "." + percentileFormat.format(percentile * 100) + "percentile", timer,
t -> t.percentile(percentile, getBaseTimeUnit()));
break;
case Telegraf:
gauge(id.getName() + "." + percentileFormat.format(percentile * 100) + ".percentile", timer,
t -> t.percentile(percentile, getBaseTimeUnit()));
break;
case Etsy:
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", percentileFormat.format(percentile * 100)),
timer, t -> t.percentile(percentile, getBaseTimeUnit()));
break;
}
}
if (histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(id.getName() + ".histogram", Tags.concat(getConventionTags(id), "bucket",
percentileFormat.format(TimeUtils.nanosToUnit(bucket, TimeUnit.MILLISECONDS))),
timer, s -> s.histogramCountAtValue(bucket));
}
}
return timer;
}
示例6: newDistributionSummary
import io.micrometer.core.instrument.histogram.HistogramConfig; //导入方法依赖的package包/类
@Override
protected DistributionSummary newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig) {
DistributionSummary summary = new StatsdDistributionSummary(id, lineBuilder(id), publisher, clock, histogramConfig, statsdConfig.step().toMillis());
for (double percentile : histogramConfig.getPercentiles()) {
switch (statsdConfig.flavor()) {
case Datadog:
gauge(id.getName() + "." + percentileFormat.format(percentile * 100) + "percentile", summary,
s -> s.percentile(percentile));
break;
case Telegraf:
gauge(id.getName() + "." + percentileFormat.format(percentile * 100) + ".percentile", summary,
s -> s.percentile(percentile));
break;
case Etsy:
gauge(id.getName(), Tags.concat(getConventionTags(id), "percentile", percentileFormat.format(percentile * 100)),
summary, s -> s.percentile(percentile));
break;
}
}
if (histogramConfig.isPublishingHistogram()) {
for (Long bucket : histogramConfig.getHistogramBuckets(false)) {
more().counter(id.getName() + ".histogram", Tags.concat(getConventionTags(id), "bucket",
Long.toString(bucket)), summary, s -> s.histogramCountAtValue(bucket));
}
}
return summary;
}