Class NullCounters
java.lang.Object
org.pipservices3.components.count.NullCounters
- All Implemented Interfaces:
ICounters
Dummy implementation of performance counters that doesn't do anything.
It can be used in testing or in situations when counters is required but shall be disabled.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginTiming(String name) Begins measurement of execution time interval.voidIncrements counter by given value.voidincrementOne(String name) Increments counter by 1.voidRecords the last calculated measurement value.voidCalculates min/average/max statistics based on the current and previous values.voidtimestamp(String name, ZonedDateTime value) Records the given timestamp.voidtimestampNow(String name) Records the current time as a timestamp.
-
Constructor Details
-
NullCounters
public NullCounters()Creates a new instance of the counter.
-
-
Method Details
-
beginTiming
Begins measurement of execution time interval. It returns CounterTiming object which has to be called atCounterTiming.endTiming()to end the measurement and update the counter.- Specified by:
beginTimingin interfaceICounters- Parameters:
name- a counter name of Interval type.- Returns:
- a CounterTiming callback object to end timing.
-
stats
Calculates min/average/max statistics based on the current and previous values. -
last
Records the last calculated measurement value.Usually this method is used by metrics calculated externally.
-
timestampNow
Records the current time as a timestamp.- Specified by:
timestampNowin interfaceICounters- Parameters:
name- a counter name of Timestamp type.
-
timestamp
Records the given timestamp. -
incrementOne
Increments counter by 1.- Specified by:
incrementOnein interfaceICounters- Parameters:
name- a counter name of Increment type.
-
increment
Increments counter by given value.
-