pl.allegro.tech.hermes.common.metric.PersistentBufferMetrics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-common Show documentation
Show all versions of hermes-common Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.common.metric;
import io.micrometer.core.instrument.MeterRegistry;
import java.util.function.ToDoubleFunction;
import static pl.allegro.tech.hermes.common.metric.Gauges.BACKUP_STORAGE_SIZE;
public class PersistentBufferMetrics {
private final MeterRegistry meterRegistry;
public PersistentBufferMetrics(MeterRegistry meterRegistry) {
this.meterRegistry = meterRegistry;
}
public void registerBackupStorageSizeGauge(T obj, ToDoubleFunction f) {
meterRegistry.gauge(BACKUP_STORAGE_SIZE, obj, f);
}
}