Package com.thingworx.metrics
Interface ICounter<T extends java.lang.Number>
-
- Type Parameters:
T
- the numeric type the counter supports
- All Superinterfaces:
IMetric
@ThingworxExtensionApiClass(since={8,1,1}) public interface ICounter<T extends java.lang.Number> extends IMetric
A metric that tracks relative changes to a numeric value.
-
-
Field Summary
-
Fields inherited from interface com.thingworx.metrics.IMetric
METRIC_TYPE, VALUE, VALUE_TYPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
decr()
Decrements the counter by one.default void
decr(boolean aggregate)
Decrements the counter by one.void
decr(T value)
Decrements the counter by the supplied value.void
decr(T value, boolean persist)
Decrements the counter by the supplied value with optional persistence.void
decr(T value, boolean persist, boolean aggregate)
Decrements the counter by the supplied value with optional persistence.T
get()
Returns the counter's current value.default void
incr()
Increments the counter by one.default void
incr(boolean aggregate)
Increments the counter by one.void
incr(T value)
Increments the counter by the supplied value.void
incr(T value, boolean persist)
Increments the counter by the supplied value with optional persistence.void
incr(T value, boolean persist, boolean aggregate)
Increments the counter by the supplied value with optional persistence.
-
-
-
Method Detail
-
incr
@ThingworxExtensionApiMethod(since={8,1,1}) void incr(T value)
Increments the counter by the supplied value.- Parameters:
value
- the amount to increment by
-
incr
@ThingworxExtensionApiMethod(since={8,3}) void incr(T value, boolean persist)
Increments the counter by the supplied value with optional persistence.- Parameters:
value
- the amount to increment bypersist
- whether or not to persist the counter data
-
incr
@ThingworxExtensionApiMethod(since={9,0}) void incr(T value, boolean persist, boolean aggregate)
Increments the counter by the supplied value with optional persistence.- Parameters:
value
- the amount to increment bypersist
- whether or not to persist the counter dataaggregate
- whether or not to aggregate in a cluster environment
-
incr
@ThingworxExtensionApiMethod(since={8,1,1}) default void incr()
Increments the counter by one.
-
incr
@ThingworxExtensionApiMethod(since={9,0,0}) default void incr(boolean aggregate)
Increments the counter by one.- Parameters:
aggregate
- whether or not to aggregate in a cluster environment
-
decr
@ThingworxExtensionApiMethod(since={8,1,1}) void decr(T value)
Decrements the counter by the supplied value.- Parameters:
value
- the amount to decrement by
-
decr
@ThingworxExtensionApiMethod(since={8,3}) void decr(T value, boolean persist)
Decrements the counter by the supplied value with optional persistence.- Parameters:
value
- the amount to decrement bypersist
- whether or not to persist the counter data
-
decr
@ThingworxExtensionApiMethod(since={9,0}) void decr(T value, boolean persist, boolean aggregate)
Decrements the counter by the supplied value with optional persistence.- Parameters:
value
- the amount to decrement bypersist
- whether or not to persist the counter dataaggregate
- whether or not to aggregate in a cluster environment
-
decr
@ThingworxExtensionApiMethod(since={8,1,1}) default void decr()
Decrements the counter by one.
-
decr
@ThingworxExtensionApiMethod(since={9,0,0}) default void decr(boolean aggregate)
Decrements the counter by one.- Parameters:
aggregate
- whether or not to aggregate in a cluster environment
-
get
@ThingworxExtensionApiMethod(since={8,3}) T get()
Returns the counter's current value.- Returns:
- the counter's current value
-
-