Class HealthCheckCounter
- java.lang.Object
-
- fish.payara.microprofile.metrics.healthcheck.HealthCheckCounter
-
- All Implemented Interfaces:
HealthCheckStatsProvider,org.eclipse.microprofile.metrics.Counter,org.eclipse.microprofile.metrics.Counting,org.eclipse.microprofile.metrics.Metric
public class HealthCheckCounter extends Object implements org.eclipse.microprofile.metrics.Counter, HealthCheckStatsProvider
Implementation of a counter based off an HealthCheck. As this is just a proxy for the HealthCheck calling theinc()method will throw anUnsupportedOperationException. Just use thegetCount()method to get the value of the HealthCheck backing this.
-
-
Constructor Summary
Constructors Constructor Description HealthCheckCounter(HealthCheckStatsProvider healthCheck, ServiceExpression expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getAttributes()longgetCount()Set<String>getSubAttributes()<T> TgetValue(Class<T> type, String attribute, String subAttribute)voidinc()ThrowsUnsupportedOperationException- this is all dealt with by the backing HealthCheckvoidinc(long n)ThrowsUnsupportedOperationException- this is all dealt with by the backing HealthCheckbooleanisEnabled()
-
-
-
Constructor Detail
-
HealthCheckCounter
public HealthCheckCounter(HealthCheckStatsProvider healthCheck, ServiceExpression expression)
-
-
Method Detail
-
inc
public void inc()
ThrowsUnsupportedOperationException- this is all dealt with by the backing HealthCheck- Specified by:
incin interfaceorg.eclipse.microprofile.metrics.Counter
-
inc
public void inc(long n)
ThrowsUnsupportedOperationException- this is all dealt with by the backing HealthCheck- Specified by:
incin interfaceorg.eclipse.microprofile.metrics.Counter- Parameters:
n- the increment value
-
getCount
public long getCount()
- Specified by:
getCountin interfaceorg.eclipse.microprofile.metrics.Counter- Specified by:
getCountin interfaceorg.eclipse.microprofile.metrics.Counting
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceHealthCheckStatsProvider
-
getValue
public <T> T getValue(Class<T> type, String attribute, String subAttribute)
- Specified by:
getValuein interfaceHealthCheckStatsProvider
-
getAttributes
public Set<String> getAttributes()
- Specified by:
getAttributesin interfaceHealthCheckStatsProvider
-
getSubAttributes
public Set<String> getSubAttributes()
- Specified by:
getSubAttributesin interfaceHealthCheckStatsProvider
-
-