io.micrometer.core.instrument.internal.DefaultGauge Java Examples

The following examples show how to use io.micrometer.core.instrument.internal.DefaultGauge. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrometheusMeterRegistry.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
protected <T> io.micrometer.core.instrument.Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
    Gauge gauge = new DefaultGauge<>(id, obj, valueFunction);
    applyToCollector(id, (collector) -> {
        List<String> tagValues = tagValues(id);
        collector.add(tagValues, (conventionName, tagKeys) -> Stream.of(new MicrometerCollector.Family(Collector.Type.GAUGE, conventionName,
                new Collector.MetricFamilySamples.Sample(conventionName, tagKeys, tagValues, gauge.value()))));
    });
    return gauge;
}
 
Example #2
Source File: StepMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
    return new DefaultGauge<>(id, obj, valueFunction);
}
 
Example #3
Source File: SimpleMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
    return new DefaultGauge<>(id, obj, valueFunction);
}
 
Example #4
Source File: OpenTSDBMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
    return new DefaultGauge<>(id, obj, valueFunction);
}
 
Example #5
Source File: WavefrontMeterRegistry.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) {
    return new DefaultGauge<>(id, obj, valueFunction);
}
 
Example #6
Source File: SkywalkingMeterRegistry.java    From skywalking with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> io.micrometer.core.instrument.Gauge newGauge(Meter.Id id, T obj, ToDoubleFunction<T> valueFunction) {
    final MeterId meterId = convertId(id);
    MeterFactory.gauge(meterId, () -> valueFunction.applyAsDouble(obj)).build();
    return new DefaultGauge<>(id, obj, valueFunction);
}
 
Example #7
Source File: DefaultDestinationPublishingMeterRegistry.java    From spring-cloud-stream with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> Gauge newGauge(Meter.Id id, T obj, ToDoubleFunction<T> f) {
	return new DefaultGauge<>(id, obj, f);
}