Class Counter
java.lang.Object
com.codename1.backend.metrics.Instrument
com.codename1.backend.metrics.Counter
A count that only goes up -- requests served, jobs run, errors seen. Exported as a cumulative monotonic sum.
Recording is one atomic add: no lock, no allocation.
-
Field Summary
Fields inherited from class Instrument
COUNTER, GAUGE, HISTOGRAM, UP_DOWN_COUNTER -
Method Summary
Methods inherited from class Instrument
getDescription, getKind, getName, getUnit
-
Method Details
-
increment
public void increment()Adds one. -
add
public void add(long amount) Addsamount. A counter refuses a negative amount, since a cumulative monotonic sum that falls reads as a reset to every backend; an up-down counter takes either sign. -
get
public long get() -
points
Description copied from class:InstrumentThe current points, each a map withattributes(a map, possibly empty) and eithervalueor, for a histogram,count,sum,min,max,boundsandbuckets.- Specified by:
pointsin classInstrument
-