Interface ICounter<T extends Number>

Type Parameters:
T - the numeric type the counter supports
All Superinterfaces:
IMetric

@ThingworxExtensionApiClass(since={8,1,1}) public interface ICounter<T extends 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

    Modifier and Type
    Method
    Description
    default void


    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.
    get()


    Returns the counter's current value.
    default void


    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.

    Methods inherited from interface com.thingworx.metrics.IMetric

    key
  • Method Details

    • 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 by
      persist - 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 by
      persist - whether or not to persist the counter data
      aggregate - 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 by
      persist - 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 by
      persist - whether or not to persist the counter data
      aggregate - 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



      Returns the counter's current value.
      Returns:
      the counter's current value