Package com.thingworx.metrics.v2
Class MetricsV2
java.lang.Object
com.thingworx.metrics.v2.MetricsV2
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IAsyncCounter
asyncCounter
(String name)
Gets the instance of the AsyncCounter metric.static IAsyncCounter
asyncCounter
(String name, Supplier<MetricRecord> callBack)
Gets the instance of asynccounter metric if present or Creates the instance if not present.static IAsyncCounter
asyncCounter
(String name, Supplier<MetricRecord> callBack, MetricOptions options)
Gets the instance of asynccounter metric if present or Creates the instance if not present.static IAsyncGauge
asyncGauge
(String name)
Gets the instance of the AsyncGauge metric.static IAsyncGauge
asyncGauge
(String name, Supplier<MetricRecord> callBack, MetricOptions options)
Gets the instance of asyncgauge metric if present or Creates the instance if not present.static ICounter
Gets the instance of the up counter metric.static ICounter
counter
(String name, MetricOptions options)
Gets the instance of up counter metric if present or Creates the instance if not present.static IHistogram
Gets the instance of the histogram metric.static IHistogram
explicitBucketHistogram
(String name, List<Double> bucketBounderies)
Gets the instance of histogram metric if present or Creates the instance if not present.static IHistogram
explicitBucketHistogram
(String name, List<Double> bucketBounderies, MetricOptions options)
Gets the instance of histogram metric if present or Creates the instance if not present.static IGauge
Gets the instance of the Gauge metric.static IGauge
gauge
(String name, MetricOptions options)
Gets the instance of gauge metric if present or Creates the instance if not present.static ICounter
upDownCounter
(String name)
Gets the instance of the upDown counter metric.static ICounter
upDownCounter
(String name, MetricOptions options)
Gets the instance of upDown counter metric if present or Creates the instance if not present.
-
Field Details
-
EXT_INSTRUMENTATION_SCOPE_NAME
-
-
Constructor Details
-
MetricsV2
protected MetricsV2()
-
-
Method Details
-
gauge
Gets the instance of the Gauge metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
gauge
@ThingworxExtensionApiMethod(since={9,7,0}) public static IGauge gauge(String name, MetricOptions options)
Gets the instance of gauge metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.options
- instance of MetricOptions (metadata of the metric).
-
asyncGauge
Gets the instance of the AsyncGauge metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
asyncGauge
@ThingworxExtensionApiMethod(since={9,7,0}) public static IAsyncGauge asyncGauge(String name, Supplier<MetricRecord> callBack, MetricOptions options)
Gets the instance of asyncgauge metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.callBack
- supplier a MetricRecord is used to manufacture a Gauge.options
- instance of MetricOptions (metadata of the metric).
-
upDownCounter
Gets the instance of the upDown counter metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
upDownCounter
@ThingworxExtensionApiMethod(since={9,7,0}) public static ICounter upDownCounter(String name, MetricOptions options)
Gets the instance of upDown counter metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.options
- instance of MetricOptions (metadata of the metric).
-
counter
Gets the instance of the up counter metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
counter
@ThingworxExtensionApiMethod(since={9,7,0}) public static ICounter counter(String name, MetricOptions options)
Gets the instance of up counter metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.options
- instance of MetricOptions (metadata of the metric).
-
asyncCounter
Gets the instance of the AsyncCounter metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
asyncCounter
@ThingworxExtensionApiMethod(since={9,7,0}) public static IAsyncCounter asyncCounter(String name, Supplier<MetricRecord> callBack)
Gets the instance of asynccounter metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.callBack
- supplier a MetricRecord that is used to manufacture a AsyncCounter.
-
asyncCounter
@ThingworxExtensionApiMethod(since={9,7,0}) public static IAsyncCounter asyncCounter(String name, Supplier<MetricRecord> callBack, MetricOptions options)
Gets the instance of asynccounter metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not- Parameters:
name
- of the metric being requested.callBack
- supplier a MetricRecord that is used to manufacture a AsyncCounter.options
- instance of MetricOptions (metadata of the metric).
-
explicitBucketHistogram
@ThingworxExtensionApiMethod(since={9,7,0}) public static IHistogram explicitBucketHistogram(String name)
Gets the instance of the histogram metric. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.
-
explicitBucketHistogram
@ThingworxExtensionApiMethod(since={9,7,0}) public static IHistogram explicitBucketHistogram(String name, List<Double> bucketBounderies)
Gets the instance of histogram metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a runtime exception if it's not.- Parameters:
name
- of the metric being requested.bucketBounderies
- Set the explicit bucket buckets boundaries advice.
-
explicitBucketHistogram
@ThingworxExtensionApiMethod(since={9,7,0}) public static IHistogram explicitBucketHistogram(String name, List<Double> bucketBounderies, MetricOptions options)
Gets the instance of histogram metric if present or Creates the instance if not present. This method verifies that the requested metrics is an external metrics and throws a ValidationException exception if it's not.- Parameters:
name
- of the metric being requested.bucketBounderies
- set the explicit bucket buckets boundaries advice.options
- instance of MetricOptions (metadata of the metric).
-