Counter metrics can be used to count the occurrences of a certain condition on a metric.
Creating a Counter metric
To add a new Counter metric to a Thing Definition, you should:
- Enter the Computed Data page.
- Select the Thing Definitions tab.
- Select the Thing Definition to edit.
- Press the Add Metric button.
- Select the Counter type and provide the required information.
- Press the Save button and edit the additional information, if needed.
Editing a Counter metric
The configuration of a Counter metric is subdivided into several sections:
General
- Label: the metric label shown within the widget.
- Name: the name of the metric, also used to reference it within the dashboard's templates.
- Description: the text describing the metric.
The description is displayed as a tooltip within the dashboard widgets. - Unit: the unit of measurement (e.g. Kg, °C, pieces, liters...etc.)
- Group: the group the metric belongs to (e.g. Temperatures, System).
- Privatizable by customer: allow the customer to define whether the metric is private or not.
For more details, refer to this Privatizable date article.
Counting
- Count Metric: the base metric whose values must be counted or summed.
- Counter: the counter applied to the count metric.
-
-
Count: count each time a message of the associated metric is received or the condition, if specified.
-
Sum: sum the value of the associated metric each time a message is received or the condition, if specified.
-
Elapsed time: counts the time elapsed by the associated metric in a specific state (in this case the condition is mandatory).
-
- Force to greater equal than zero: in case of SUM counter, the result count value cannot be less than zero.
Count Condition
In this section is possible to configure the condition used for counting, if defined the counter is updated each time the condition on the associated metric is verified.
A condition is configured by specifying the predicate and the expected value.
Range
In this section, you can specify the minimum and maximum values the metric can assume.
Minimum and maximum values can also be dynamically redefined by specifying a property or a metric for them.
Thresholds
In this section, you can specify the intermediate thresholds. This information is used by widgets (e.g. Radial Gauge) to highlight values according to the thresholds (e.g. value > 75 → amber, value > 90 → red). A threshold can also be dynamic by using a property or another metric. You can define static thresholds between the min and max values, and then redefine the thresholds by using metrics or properties.
It is up to you to use plausible values that are contained in the min and max values.
Reset
In this section you can configure how the counter can be reset.
- Reset Condition: you can specify a metric based condition that when true causes the counter to be reset to its reset value.
- Reset Period: you can specify whether the counter must be automatically reset on a time basis (e.g. each day) to the reset value. The reset takes place according to the thing timezone.
- Reset Value: the value to be saved for the counter in case of a reset occur.
The default reset value is zero. - Editable Reset Value: the flag indicating whether the user can provide the new counter value in case of manual reset.
Comments
0 comments
Please sign in to leave a comment.