This topic defines metrics, metric domains, and metric types.
Metric
A metric, also known as a measure, is a standard for measuring change or development. Examples include temperature, population, GDP, revenue, number of users, profit margin, retention rate, and coverage rate.
Metric domain
A metric domain is the object associated with a metric, used to categorize and manage metrics. IoT Data Service provides two metric domains: product and device.
Metric type
-
Original definition
Original definition metrics are derived from the thing model of a product in IoT Platform.
In the IoT Platform console, navigate to Device Management > Product, select a product to open its Product Details page, then click Function Definition to view the defined thing model.
-
Raw metric
Raw metrics originate from properties that devices report to IoT Platform or from properties parsed from custom topics.
In the IoT Platform console, navigate to Device Management > Device to open the Device Details page. Click TSL Data to view properties. For example, on the Device Details page, choose TSL Data > Running Status to view properties reported by a device, such as metrics from an electrical parameter measuring instrument: load power (28 kW), operating current (15 A), and voltage (20 V).
-
Derived definition
A derived definition is based on an original definition and applied to the sub-entities of a product.
Similar to an original definition, a derived definition is a property definition and does not have a specific data value.
The aggregated data becomes the value for each device's derived metric.
A product's derived definition and the derived metric for each device under that product share the same metric code.
-
Derived metric
A derived metric is calculated from raw metrics, original definitions, or derived definitions by using aggregation methods such as sum and average.
For a derived metric, a time modifier defines the aggregation time range (the time constraint), and business modifiers define other constraints.
Therefore, a derived metric consists of three elements: time modifier (required) + business modifier (optional) + atomic metric (required).
To learn how to add a metric, see Add Metric.
Metric type applicability
The following table shows which metric types are supported in each metric domain.
|
Type |
Product |
Device |
|
Original definition |
Supported |
Not supported |
|
Raw metric |
Not supported |
Supported |
|
Derived definition |
Supported |
Not supported |
|
Derived metric |
Supported |
Supported |
A device under a product can include metrics of both the derived definition and derived metric types.
For example, consider a derived definition for product PK1 named Average Temperature in the Last 24 Hours. This product has 100 devices, named DNn (where n=1 to 100). Creating a separate Average Temperature in the Last 24 Hours derived metric for each device would require repeating the configuration 100 times. However, creating a single derived definition for product PK1 automatically creates the Average Temperature in the Last 24 Hours derived metric for all 100 devices.