Metrics Export Data Experimental Extension
Contents
Metrics Export Data Experimental Extension¶
API¶
Structures
Functions
Sample Code¶
The following code shows how to export metrics raw data for a metric group.
// Get size for export data size_t exportDataSize = 0; uint32_t dataCount = 0; uint32_t totalMetricCount = 0; zet_metric_group_calculation_type_t type = ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES; zetMetricGroupCalculateMetricExportDataExp(hDriver, type, &exportDataSize, nullptr, nullptr, &dataCount, &totalMetricCount, nullptr, nullptr); // Allocate buffer for export data uint8_t* pExportData = malloc(exportDataSize); // Retrieve export data and data format zetMetricGroupCalculateMetricExportDataExp(hDriver, type, &exportDataSize, pExportData, nullptr, &dataCount, &totalMetricCount, nullptr, nullptr);
The following code shows how to perform metrics calculation of collected data, which can be done in a different system than where data was collected.
// Get data count and total metric count zet_metric_group_calculation_type_t type = ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES; zet_metric_calculate_exp_desc_t calculateDesc; calculateDesc.rawReportSkipCount = 0; zetMetricGroupCalculateMetricExportDataExp(hDriver, type, exportDataSize, pExportData, &calculateDesc, &dataCount, &totalMetricCount, nullptr, nullptr); void* pMetricCounts = malloc(dataCount * sizeof(uint32_t)); void* pMetricValues = malloc(totalMetricCount * sizeof(zet_typed_value_t)); // Get metric counts and metric values zetMetricGroupCalculateMetricExportDataExp(hDriver, type, exportDataSize, pExportData, &calculateDesc, &dataCount, &totalMetricCount, pMetricCounts, pMetricValues);