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()
long
getCount()
Set<String>
getSubAttributes()
<T> T
getValue(Class<T> type, String attribute, String subAttribute)
void
inc()
ThrowsUnsupportedOperationException
- this is all dealt with by the backing HealthCheckvoid
inc(long n)
ThrowsUnsupportedOperationException
- this is all dealt with by the backing HealthCheckboolean
isEnabled()
-
-
-
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:
inc
in interfaceorg.eclipse.microprofile.metrics.Counter
-
inc
public void inc(long n)
ThrowsUnsupportedOperationException
- this is all dealt with by the backing HealthCheck- Specified by:
inc
in interfaceorg.eclipse.microprofile.metrics.Counter
- Parameters:
n
- the increment value
-
getCount
public long getCount()
- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.Counter
- Specified by:
getCount
in interfaceorg.eclipse.microprofile.metrics.Counting
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceHealthCheckStatsProvider
-
getValue
public <T> T getValue(Class<T> type, String attribute, String subAttribute)
- Specified by:
getValue
in interfaceHealthCheckStatsProvider
-
getAttributes
public Set<String> getAttributes()
- Specified by:
getAttributes
in interfaceHealthCheckStatsProvider
-
getSubAttributes
public Set<String> getSubAttributes()
- Specified by:
getSubAttributes
in interfaceHealthCheckStatsProvider
-
-