A predefined metric table is a collection of default metrics that IoT Data Service Platform uses to describe device status. Data collection for these metrics is disabled by default. You can enable a predefined metric table to collect metric data and generate a data API to retrieve the aggregated results.
Prerequisites
You have completed a data backup for your product. For more information, see data backup.
Billing
Enabling a predefined metric table to collect data consumes Computing Units (CUs). For more information, see Data Service Billing Description.
View predefined metric tables
-
In the IoT Platform console, go to the Overview page and click the ID or alias of the target Enterprise Edition instance.
-
In the left-side navigation pane, choose Data Service > Data Metrics.
-
On the Predefined Metrics tab, view all predefined metric tables.
The list of predefined metric tables includes the following columns: Metric Name, Description, CU Consumption, Scheduling Type, Metric Type, and Actions. In the Actions column, click View to see the metric's details, or click Enable Metric to enable it. Use the search box at the top of the page to search by metric name.
-
(Optional) In the Actions column for a predefined metric table, click View.
The Metric Table Details page shows basic information about the metric table and its metrics, such as the metric name (for example,
connectionSuccessRate), display name (for example, Network connection success rate per minute), number of fields, and type (device). The table schema section lists each field's name, alias (Chinese name), and data type. For example, themetricValuefield has the alias Network connection success rate and a data type ofdouble.
Enable and disable data collection
Enable data collection
-
On the Predefined Metrics tab, in the Actions column, click Enable Metric for the target predefined metric table.
-
In the dialog box that appears, click Confirm.
ImportantIf your instance has insufficient CUs, a dialog box appears prompting you to upgrade your instance specifications. Follow the on-screen instructions to upgrade the CUs. For information about specifications, see Purchase Enterprise Edition instance.
After the upgrade is complete, follow the steps above to enable data collection for the metric.
The dialog box shows the available CUs and the CUs required to enable the metric. Monthly CU consumption varies by device count. Offline metrics use a T+1 aggregation model, so aggregated results are available the day after you enable the metric.
Disable data collection
-
On the Predefined Metrics tab, in the Actions column, click Disable Metric for the target predefined metric table.
-
In the dialog box that appears, click Confirm.
After you disable the metric, data collection stops. You can re-enable it at any time.
Generate data APIs
After you enable data collection for a predefined metric table, the system automatically generates a data API that you can use to retrieve the aggregated metric data.
-
On the Predefined Metrics tab, in the Actions column for the target predefined metric table, click Data Preview to view the 20 most recent records. For example, for the Daily Device Online Duration Statistics table, the preview includes fields such as Statistics Date, Max Online Duration, Min Online Duration, Average Online Duration, Device with Max Online Duration, and Device with Min Online Duration.
-
Return to the Predefined Metrics tab. In the Actions column for the same predefined metric table, click Data API Details to view its basic information and usage details.
For more information about API details and usage, see Manage and Use APIs. The basic information includes API Name, API Path, Status, Creation Time, API Type, Number of Calls, Timeout Error Condition, and Last Invocation. In the API Monitoring area, you can switch between the API O&M and API Test tabs.