Class Counters
java.lang.Object
io.datarouter.instrumentation.count.Counters
public class Counters extends Object
Static class for incrementing counts throughout an application. Register with this class to receive counts.
-
Field Summary
Fields Modifier and Type Field Description static longMS_IN_DAYstatic longMS_IN_HOURstatic longMS_IN_MINUTEstatic longMS_IN_SECOND -
Constructor Summary
Constructors Constructor Description Counters() -
Method Summary
Modifier and Type Method Description static voidaddCollector(CountCollector collector)static StringgetSuffix(long periodMs)static voidinc(String key)static voidinc(String key, long delta)static voidstopAndFlushAll()
-
Field Details
-
MS_IN_SECOND
public static final long MS_IN_SECOND -
MS_IN_MINUTE
public static final long MS_IN_MINUTE -
MS_IN_HOUR
public static final long MS_IN_HOUR -
MS_IN_DAY
public static final long MS_IN_DAY
-
-
Constructor Details
-
Counters
public Counters()
-
-
Method Details
-
getSuffix
-
addCollector
-
stopAndFlushAll
public static void stopAndFlushAll() -
inc
-
inc
-