private Summary summary(String name, List<String> labels) { String key = sanitizeName(name); return response_times.computeIfAbsent(key, k-> Summary.build().name(k).help(k).labelNames(labels.stream().toArray(String[]::new)).register(registry)); }
@Override public Summary create() { return Summary.build().name(name).help(name).labelNames(tags).create().register(); } }
private Summary registerSummary(String name, String help) { return Summary.build() .name(name) .labelNames("pool") .help(help) .quantile(0.5, 0.05) .quantile(0.95, 0.01) .quantile(0.99, 0.001) .maxAgeSeconds(TimeUnit.MINUTES.toSeconds(5)) .ageBuckets(5) .create(); }
@Override public Summary create() { return Summary.build() .name(name) .help(name) .labelNames(tags) .quantile(0.5, 0.05) .quantile(0.75, 0.05) .quantile(0.99, 0.05) .create() .register(); } }
summary = Summary.build() .name(annot.name()) .help(annot.help())
public PrometheusSummary(SummaryConfiguration configuration) { this(Summary.build(), configuration); }
@Setup public void setup() { prometheusSummary = io.prometheus.client.metrics.Summary.newBuilder() .name("name") .documentation("some description..") .build(); prometheusSummaryChild = prometheusSummary.newPartial().apply(); prometheusSimpleSummary = io.prometheus.client.Summary.build() .name("name") .help("some description..") .labelNames("some", "group").create(); prometheusSimpleSummaryChild = prometheusSimpleSummary.labels("test", "group"); prometheusSimpleSummaryNoLabels = io.prometheus.client.Summary.build() .name("name") .help("some description..") .create(); prometheusSimpleHistogram = io.prometheus.client.Histogram.build() .name("name") .help("some description..") .labelNames("some", "group").create(); prometheusSimpleHistogramChild = prometheusSimpleHistogram.labels("test", "group"); prometheusSimpleHistogramNoLabels = io.prometheus.client.Histogram.build() .name("name") .help("some description..") .create(); registry = new MetricRegistry(); codahaleHistogram = registry.histogram("name"); }
public DimensionStats(String name, long updateDurationInSec) { this.name = name; this.dimensionSumLabel = name + "_sum"; this.dimensionCountLabel = name + "_count"; Builder summaryBuilder = Summary.build().name(name).help("-"); for (int i = 0; i < QUANTILES.length; i++) { summaryBuilder.quantile(QUANTILES[i], 0.01); } this.summary = summaryBuilder.maxAgeSeconds(updateDurationInSec).create(); try { defaultRegistry.register(summary); } catch (IllegalArgumentException ie) { // it only happens in test-cases when try to register summary multiple times in registry log.warn("{} is already registred {}", name, ie.getMessage()); } }
summary = Summary.build() .name(annot.name()) .help(annot.help())
PrometheusMetricsTracker(String poolName) { super(); Counter counter = Counter.build() .name("hikaricp_connection_timeout_count") .labelNames("pool") .help("Connection timeout count") .register(); this.connectionTimeoutCounter = counter.labels(poolName); Summary elapsedAcquiredSummary = Summary.build() .name("hikaricp_connection_acquired_nanos") .labelNames("pool") .help("Connection acquired time") .register(); this.elapsedAcquiredSummary = elapsedAcquiredSummary.labels(poolName); Summary elapsedBorrowedSummary = Summary.build() .name("hikaricp_connection_usage_millis") .labelNames("pool") .help("Connection usage") .register(); this.elapsedBorrowedSummary = elapsedBorrowedSummary.labels(poolName); }
protected void createAssertionCollector(){ if (!collectAssertions){ return; } String[] labelNames = new String[]{}; if (SampleEvent.getVarCount() > 0) { labelNames = this.combineAssertionLabelsWithSampleVars(); }else { labelNames = this.assertionConfig.getLabels(); } if(this.getSaveConfig().getAssertionClass().equals(Summary.class)) this.assertionsCollector = Summary.build().name("jmeter_assertions_total").help("Counter for assertions") .labelNames(labelNames).quantile(0.5, 0.1).quantile(0.99, 0.1) .create().register(CollectorRegistry.defaultRegistry); else if(this.getSaveConfig().getAssertionClass().equals(Counter.class)) this.assertionsCollector = Counter.build().name("jmeter_assertions_total").help("Counter for assertions") .labelNames(labelNames).create().register(CollectorRegistry.defaultRegistry); }
this.samplerCollector = Summary.build() .name("jmeter_samples_latency") .help("Summary for Sample Latency") this.samplerLatencyCollector = Summary.build() .name("jmeter_samples_ttfb_seconds") .help("Summary for sample latency(TTFB) in seconds") .create() .register(CollectorRegistry.defaultRegistry); this.samplerElaspedTimeCollector = Summary.build() .name("jmeter_samples_duration_seconds") .help("Summary for sample duration in seconds") .create() .register(CollectorRegistry.defaultRegistry); this.samplerIdleTimeCollector = Summary.build() .name("jmeter_samples_idle_time_seconds") .help("Summary for sample idle time in seconds") .create() .register(CollectorRegistry.defaultRegistry); this.samplerConnectTimeCollector = Summary.build() .name("jmeter_samples_connect_time_seconds") .help("Summary for sample connect time in seconds")
.create(); overallFleSizeDistribution = overallHistogram; overallReplication = Summary.build() .name(FsImageCollector.METRIC_PREFIX + REPLICATION) .help("Overall file replication").create(); Summary summary = Summary.build() .name(FsImageCollector.METRIC_PREFIX_GROUP + FSIZE) .labelNames(FsImageCollector.LABEL_GROUP_NAME) userReplication = Summary.build() .name(FsImageCollector.METRIC_PREFIX_USER + REPLICATION) .labelNames(FsImageCollector.LABEL_USER_NAME) .help("Per user file replication").create(); if (config.isSkipFileDistributionForUserStats()) { Summary summary = Summary.build() .name(FsImageCollector.METRIC_PREFIX_USER + FSIZE) .labelNames(FsImageCollector.LABEL_USER_NAME) Summary summary = Summary.build() .name(FsImageCollector.METRIC_PREFIX_PATH + FSIZE) .labelNames(FsImageCollector.LABEL_PATH) Summary summary = Summary.build() .name(FsImageCollector.METRIC_PREFIX_PATH_SET + FSIZE) .labelNames(FsImageCollector.LABEL_PATH_SET)