use of io.micrometer.core.instrument.internal.DefaultLongTaskTimer in project micrometer by micrometer-metrics.
the class PrometheusMeterRegistry method newLongTaskTimer.
@Override
protected LongTaskTimer newLongTaskTimer(Meter.Id id) {
MicrometerCollector collector = collectorByName(id);
LongTaskTimer ltt = new DefaultLongTaskTimer(id, clock);
List<String> tagValues = tagValues(id);
collector.add((conventionName, tagKeys) -> Stream.of(new MicrometerCollector.Family(Collector.Type.UNTYPED, conventionName, Stream.of(new Collector.MetricFamilySamples.Sample(conventionName + "_active_count", tagKeys, tagValues, ltt.activeTasks()), new Collector.MetricFamilySamples.Sample(conventionName + "_duration_sum", tagKeys, tagValues, ltt.duration(TimeUnit.SECONDS))))));
return ltt;
}
use of io.micrometer.core.instrument.internal.DefaultLongTaskTimer in project micrometer by micrometer-metrics.
the class DropwizardMeterRegistry method newLongTaskTimer.
@Override
protected LongTaskTimer newLongTaskTimer(Meter.Id id) {
LongTaskTimer ltt = new DefaultLongTaskTimer(id, clock);
registry.register(hierarchicalName(id.withTag(Statistic.ACTIVE_TASKS)), (Gauge<Integer>) ltt::activeTasks);
registry.register(hierarchicalName(id.withTag(Statistic.DURATION)), (Gauge<Double>) () -> ltt.duration(TimeUnit.NANOSECONDS));
return ltt;
}
Aggregations