Package com.thingworx.common.utils
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueCollectionCreate a ValueCollection that can be added to an InfoTable as a row, representing a single metric.static ValueCollectionCreate a ValueCollection that can be added to an InfoTable as a row, representing a single metric.static ValueCollectionCreate a ValueCollection that can be added to an InfoTable as a row, representing a single metric.static ValueCollectioncreate(String name, String description, NumberPrimitive value) Create a ValueCollection that can be added to an InfoTable as a row, representing a single metric.
-
Constructor Details
-
ThingworxMetric
public ThingworxMetric()Initializes this instace with default values.
-
-
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 metricdescription- Description of the metricvalue- 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 metricdescription- Description of the metricvalue- 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 metricdescription- Description of the metricvalue- 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 metricdescription- Description of the metricvalue- The metrics value- Returns:
- A ValueCollection representing the metric
-