Interface IGauge<T>

Type Parameters:
T - the data type stored by this gauge
All Superinterfaces:
IMetric

@ThingworxExtensionApiClass(since={8,1,1}) public interface IGauge<T> extends IMetric
A metric that stores a single value. Gauges are guaranteed to be updated in a thread-safe manner.
  • Field Summary

    Fields inherited from interface com.thingworx.metrics.IMetric

    METRIC_TYPE, VALUE, VALUE_TYPE
  • Method Summary

    Modifier and Type
    Method
    Description
    get()


    Retrieves the current value of the gauge.
    void
    set(T value)


    Assigns a new value to the gauge
    void
    set(T value, boolean persist)


    Assigns a new value to the gauge with optional persistence
    void
    set(T value, boolean persist, boolean aggregate)


    Assigns a new value to the gauge with optional persistence

    Methods inherited from interface com.thingworx.metrics.IMetric

    key
  • Method Details

    • get



      Retrieves the current value of the gauge.
      Returns:
      the current value
    • set

      @ThingworxExtensionApiMethod(since={8,1,1}) void set(T value)


      Assigns a new value to the gauge
      Parameters:
      value - the new value
    • set

      @ThingworxExtensionApiMethod(since={8,3}) void set(T value, boolean persist)


      Assigns a new value to the gauge with optional persistence
      Parameters:
      value - the new value
      persist - whether or not to persist the gauge data
    • set

      @ThingworxExtensionApiMethod(since={9,0}) void set(T value, boolean persist, boolean aggregate)


      Assigns a new value to the gauge with optional persistence
      Parameters:
      value - the new value
      persist - whether or not to persist the gauge data
      aggregate - whether or not to aggregate this metric in a cluster environment