pl.allegro.tech.hermes.common.metric.SubscriptionHermesCounter 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.Counter;
import pl.allegro.tech.hermes.api.SubscriptionName;
import pl.allegro.tech.hermes.metrics.counters.DefaultHermesCounter;
public class SubscriptionHermesCounter extends DefaultHermesCounter {
private final SubscriptionName subscription;
private SubscriptionHermesCounter(Counter micrometerCounter,
SubscriptionName subscription) {
super(micrometerCounter);
this.subscription = subscription;
}
public static SubscriptionHermesCounter from(Counter micrometerCounter, SubscriptionName subscription) {
return new SubscriptionHermesCounter(micrometerCounter, subscription);
}
SubscriptionName getSubscription() {
return subscription;
}
Counter getMicrometerCounter() {
return micrometerCounter;
}
}