Skip navigation links
Thingworx Platform API
9.0.0
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.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method and 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.
      • Methods inherited from interface com.thingworx.metrics.IMetric

        key
    • Method Detail

      • 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={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,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={9,0,0})
        default void decr(boolean aggregate)


        Decrements the counter by one.
        Parameters:
        aggregate - whether or not to aggregate in a cluster environment