All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.allegro.tech.hermes.common.metric.SubscriptionHermesCounter Maven / Gradle / Ivy

There is a newer version: 2.7.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy