Class ThingworxMetric

java.lang.Object
com.thingworx.common.utils.ThingworxMetric

@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public final class ThingworxMetric extends Object
Static helpers for easily creating Thingworx Metrics data. Implemented as statics to avoid the overhead of creating a wrapper object around ValueCollection. Intended to be used with InfoTables: it.addRow(ThingworxMetric.create("MetricName", "Metric Description", metric_value));
  • Constructor Details

    • ThingworxMetric

      public ThingworxMetric()
  • Method Details

    • create

      @ThingworxExtensionApiMethod(since={6,6}) public static ValueCollection create(String name, String description, long value)


      Create a ValueCollection that can be added to an InfoTable as a row, representing a single metric.
      Parameters:
      name - Name of the metric
      description - Description of the metric
      value - The metrics value
      Returns:
      A ValueCollection representing the metric
    • create

      @ThingworxExtensionApiMethod(since={6,6}) public static ValueCollection create(String name, String description, int value)


      Create a ValueCollection that can be added to an InfoTable as a row, representing a single metric.
      Parameters:
      name - Name of the metric
      description - Description of the metric
      value - The metrics value
      Returns:
      A ValueCollection representing the metric
    • create

      @ThingworxExtensionApiMethod(since={6,6}) public static ValueCollection create(String name, String description, double value)


      Create a ValueCollection that can be added to an InfoTable as a row, representing a single metric.
      Parameters:
      name - Name of the metric
      description - Description of the metric
      value - The metrics value
      Returns:
      A ValueCollection representing the metric
    • create

      @ThingworxExtensionApiMethod(since={6,6}) public static ValueCollection create(String name, String description, NumberPrimitive value)


      Create a ValueCollection that can be added to an InfoTable as a row, representing a single metric.
      Parameters:
      name - Name of the metric
      description - Description of the metric
      value - The metrics value
      Returns:
      A ValueCollection representing the metric