当前位置: 首页>>代码示例>>Java>>正文


Java HistogramConfig.isPublishingHistogram方法代码示例

本文整理汇总了Java中io.micrometer.core.instrument.histogram.HistogramConfig.isPublishingHistogram方法的典型用法代码示例。如果您正苦于以下问题:Java HistogramConfig.isPublishingHistogram方法的具体用法?Java HistogramConfig.isPublishingHistogram怎么用?Java HistogramConfig.isPublishingHistogram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.micrometer.core.instrument.histogram.HistogramConfig的用法示例。


在下文中一共展示了HistogramConfig.isPublishingHistogram方法的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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:20,代码来源:DropwizardMeterRegistry.java

示例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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:20,代码来源:DropwizardMeterRegistry.java

示例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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:32,代码来源:SimpleMeterRegistry.java

示例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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:33,代码来源:SimpleMeterRegistry.java

示例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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:33,代码来源:StatsdMeterRegistry.java

示例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;
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:31,代码来源:StatsdMeterRegistry.java


注:本文中的io.micrometer.core.instrument.histogram.HistogramConfig.isPublishingHistogram方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。