Unit 4: Developing and Querying Metrics¶
This unit creates the derived metrics of Solar_Site-Level_Cumulative_Generation, Site_Day-Level_Ambient_Temperature, and Site-Level_Cumulative_Horizontal_Radiance, and configures the query mapping groups based on the metric requirements and the configured dimension tables and fact tables
Step 1: Creating Derived Metrics¶
Creating the Cumulative Generation Metric of the Solar Site¶
Select Metric Library from the left navigation pane and select Derived Metric tab.
Select New, and enter the following information in the New Derived Metric Page:
Metric Type: Select
Single ValuedAssociated Atomic Metric
Metric Library: Select
Standard MetricAtomic Metric: Select
Solar Generation
Statistical Dimension: Select
dim_solarplantPeriod: Select
Beginning of LifeMetric Aggregator: Automatic generation of
SUMbased on the correlated atomic metricUnit: Automatic generation of
kWhbased on the correlated atomic metricData Type: Select
DECIMALDerived Metric ID: Select Autogenerate and generate the ID of
sumactualSolarproduction_dim_solarplant_bolDerived Metric Name: Enter
Solar_Site-Level_Cumulative_Generation
Select Publish to save and publish this derived metric.
Creating the Day-Level Ambient Temperature Metric of the Site¶
In the Derived Metric tab, select New, and enter the following information in the New Derived Metric Page:
Metric Type: Select
Single ValuedAssociated Atomic Metric
Metric Library: Select
Standard MetricAtomic Metric: Select
Average Ambient Temperature
Statistical Dimension: Select
dim_sensorPeriod: Select
This DayMetric Aggregator: Automatic generation of
AVGbased on the correlated atomic metricUnit: Automatic generation of
°Cbased on the correlated atomic metricData Type: Select
STRINGDerived Metric ID: Select Autogenerate and generate the ID of
avgambienttemp_dim_sensor_tdDerived Metric Name: Enter
Site_Day-Level_Ambient_Temperature
Select Publish to save and publish this derived metric.
Creating the Site-Level Cumulative Horizontal Radiance Metric¶
In the Derived Metric tab, select New, and enter the following information in the New Derived Metric Page:
Metric Type: Select
Single ValuedAssociated Atomic Metric
Metric Library: Select
Standard MetricAtomic Metric: Select
Cumulative Horizontal Radiance
Statistical Dimension: Select
dim_sensorPeriod: Select
Beginning of LifeMetric Aggregator: Automatic generation of
SUMbased on the correlated atomic metricUnit: Automatic generation of
Wh/m²based on the correlated atomic metricData Type: Select
STRINGDerived Metric ID: Select Autogenerate and generate the ID of
sumirradianceghi_dim_sensor_bolDerived Metric Name: Enter
Site-Level_Cumulative_Horizontal_Radiance
Select Publish to save and publish this derived metric.
Step 2: Configuring Query Mappings¶
Configuring the Query Mapping of the Cumulative Generation Metric of the Solar Site¶
Select the Query Mapping tab, select New, go to the New Mapping Configuration Group page, and enter the following information:
Group Basic Configuration
Basic Information
Group ID: Enter
solar_plant_powerMapping Configuration Group Name: Enter
Cumulated_Generation_of_the_Solar_Site
Data Source Configuration
Calculation Method: Select
Fact Table Pass-ThroughFact Tables: Select
fact_solarpowerTime Field: Select
date_timeDimension: Select
dim_solarplant
Metric Configuration:
Metric ID: Select
sumactualSolarproduction_dim_solarplant_bolFact Table Field: Select
total_yield
Select Next to preview the configuration.
Select Publish to save and publish the query mapping group.
Configuring Query Mappings of Day-Level Ambient Temperature of Site and Site-Level Cumulative Horizontal Radiance Metrics¶
Select the Query Mapping tab, select New, go to the New Mapping Configuration Group page, and enter the following information:
Group Basic Configuration
Basic Information
Group ID: Enter
plant_sensorMapping Configuration Group Name: Enter
Cumulative_Radiance_of_Ambient_Temperature_of_the_Site
Data Source Configuration
Calculation Method: Select
Fact Table Pass-ThroughFact Tables: Select
fact_sensorTime Field: Select
date_timeDimension: Select
dim_solarplant
Metric Configuration
Average Temperature Metric
Metric ID: Select
avgambienttemp_dim_sensor_tdFact Table Field: Select
ambient_temperature
Cumulated Radiance Metric
Metric ID: Select
sumirradianceghi_dim_sensor_bolFact Table Field: Select
irradiation
Select Next to preview the configuration.
Select Publish to save and publish the query mapping group.
Step 3: Querying Metrics¶
After publishing the query mapping groups, you can query the published metrics in the following two ways.
Querying Metrics in Metric Insights¶
Select Metric Insights in the left navigation pane and select the following information in the page:
Metric Type: Select
Single-ValuedStatistical Dimension: Select
dim_solarplantordim_sensorStatistical Objects: Select one or more device IDs of
solar_plantorweather_sensorMetrics: Select
Solar_Site-Level_Cumulative_Generation,Site_Day-Level_Ambient_Temperature, orSite-Level_Cumulative_Horizontal_Radiance
Click Query to insight the metrics.
Querying Metrics by Open API¶
Query the data of the metrics that have been published and configured with query mapping groups by the Open API of Metric Management:
https://{apigw-address}/metric-mgmt/v1.0/metrics/data/normal