Package com.hcl.labs.domi.metrics
Enum DOMIStatisticsHolder
- java.lang.Object
-
- java.lang.Enum<DOMIStatisticsHolder>
-
- com.hcl.labs.domi.metrics.DOMIStatisticsHolder
-
- All Implemented Interfaces:
DOMIStatistics,Serializable,Comparable<DOMIStatisticsHolder>
public enum DOMIStatisticsHolder extends Enum<DOMIStatisticsHolder> implements DOMIStatistics
Holder for Keep statistics- Author:
- Paul Stephen Withers
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.hcl.labs.domi.metrics.DOMIStatistics
DOMIStatistics.StatisticAction
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCESingleton holder for statistic data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micrometer.core.instrument.MetercreateMetricForRegistry(String key, List<io.micrometer.core.instrument.Tag> metricsTags, io.micrometer.core.instrument.Meter.Type type, io.micrometer.core.instrument.MeterRegistry registry)Creates a counter or timer for a specific registry, currently only Prometheus.Map<String,io.micrometer.core.instrument.Meter>getMetricsMap()io.micrometer.core.instrument.CountergetOrCreateCounter(String key, List<io.micrometer.core.instrument.Tag> metricsTags)Gets or creates a counter.io.micrometer.core.instrument.TimergetOrCreateTimer(String key, List<io.micrometer.core.instrument.Tag> metricsTags)Gets or creates a counter.voidincrementCounter(String key, List<io.micrometer.core.instrument.Tag> metricsTags)DOMIStatisticsreset()Resets the statistics to start over.static DOMIStatisticsHoldervalueOf(String name)Returns the enum constant of this type with the specified name.static DOMIStatisticsHolder[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DOMIStatisticsHolder INSTANCE
Singleton holder for statistic data
-
-
Method Detail
-
values
public static DOMIStatisticsHolder[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DOMIStatisticsHolder c : DOMIStatisticsHolder.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DOMIStatisticsHolder valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
createMetricForRegistry
public io.micrometer.core.instrument.Meter createMetricForRegistry(String key, List<io.micrometer.core.instrument.Tag> metricsTags, io.micrometer.core.instrument.Meter.Type type, io.micrometer.core.instrument.MeterRegistry registry)
Description copied from interface:DOMIStatisticsCreates a counter or timer for a specific registry, currently only Prometheus.- Specified by:
createMetricForRegistryin interfaceDOMIStatistics- Parameters:
key- to create metric withmetricsTags- to create metric withtype- of Meter to create. Only Timer and Counter are currently supportedregistry- registry into which to create the metric- Returns:
- Meter created
-
getMetricsMap
public Map<String,io.micrometer.core.instrument.Meter> getMetricsMap()
- Specified by:
getMetricsMapin interfaceDOMIStatistics- Returns:
- Map of metrics
-
getOrCreateCounter
public io.micrometer.core.instrument.Counter getOrCreateCounter(String key, List<io.micrometer.core.instrument.Tag> metricsTags)
Description copied from interface:DOMIStatisticsGets or creates a counter. Use this if tags require minimal computation to pass- Specified by:
getOrCreateCounterin interfaceDOMIStatistics- Parameters:
key- to create metric withmetricsTags- to create metric with- Returns:
- Meter(Counter) created
-
getOrCreateTimer
public io.micrometer.core.instrument.Timer getOrCreateTimer(String key, List<io.micrometer.core.instrument.Tag> metricsTags)
Description copied from interface:DOMIStatisticsGets or creates a counter. Use this if tags require minimal computation to pass- Specified by:
getOrCreateTimerin interfaceDOMIStatistics- Parameters:
key- to create metric withmetricsTags- to create metric with- Returns:
- Meter(Timer) created
-
incrementCounter
public void incrementCounter(String key, List<io.micrometer.core.instrument.Tag> metricsTags)
- Parameters:
key- for the metricmetricsTags- list of tags
-
reset
public DOMIStatistics reset()
Description copied from interface:DOMIStatisticsResets the statistics to start over. Mainly used when restarting keep- Specified by:
resetin interfaceDOMIStatistics- Returns:
- fluent
-
-