io.quarkus.smallrye.metrics.runtime.GetCountOnlyCounter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-smallrye-metrics Show documentation
Show all versions of quarkus-smallrye-metrics Show documentation
Expose metrics for your services
package io.quarkus.smallrye.metrics.runtime;
import org.eclipse.microprofile.metrics.Counter;
/**
* A helper abstract class for implementing counters which only need a getCount method.
* Other methods throw an exception.
*/
public abstract class GetCountOnlyCounter implements Counter {
private static final String MUST_NOT_BE_CALLED = "Must not be called";
@Override
public void inc() {
throw new IllegalStateException(MUST_NOT_BE_CALLED);
}
@Override
public void inc(long n) {
throw new IllegalStateException(MUST_NOT_BE_CALLED);
}
@Override
public abstract long getCount();
}