Package com.tagtraum.core.metric
Class Metric
- java.lang.Object
-
- com.tagtraum.core.metric.Metric
-
- All Implemented Interfaces:
Comparable<Metric>
public class Metric extends Object implements Comparable<Metric>
Metric for counting certain events.- Author:
- Hendrik Schreiber
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Metric that)
int
getCount()
Current count.static Metric
getMetric(Class<?> klass)
static Metric
getMetric(String name)
String
getName()
Name.int
incCount()
Increases count.void
logCount()
Logs the current count to the log.static void
logReport()
Logs a sorted (desc) list of all currently registered metrics.String
toString()
-
-
-
Method Detail
-
compareTo
public int compareTo(Metric that)
- Specified by:
compareTo
in interfaceComparable<Metric>
-
getName
public String getName()
Name.- Returns:
- name
-
incCount
public int incCount()
Increases count.- Returns:
- new count
-
getCount
public int getCount()
Current count.- Returns:
- count
-
logCount
public void logCount()
Logs the current count to the log.
-
logReport
public static void logReport()
Logs a sorted (desc) list of all currently registered metrics.
-
-