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 Valued
Associated Raw Metric
Metric Library: Select
Standard Metric
Raw Metric: Select
Solar Generation
Statistical Dimension: Select
dim_solarplant
Period: Select
Beginning of Life
Metric Aggregator: Automatic generation of
SUM
based on the correlated raw metricUnit: Automatic generation of
kWh
based on the correlated raw metricData Type: Select
DECIMAL
Derived Metric ID: Select Autogenerate and generate the ID of
sumactualSolarproduction_dim_solarplant_bol
Derived 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 Valued
Associated Raw Metric
Metric Library: Select
Standard Metric
Raw Metric: Select
Average Ambient Temperature
Statistical Dimension: Select
dim_sensor
Period: Select
This Day
Metric Aggregator: Automatic generation of
AVG
based on the correlated raw metricUnit: Automatic generation of
°C
based on the correlated raw metricData Type: Select
STRING
Derived Metric ID: Select Autogenerate and generate the ID of
avgambienttemp_dim_sensor_td
Derived 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 Valued
Associated Raw Metric
Metric Library: Select
Standard Metric
Raw Metric: Select
Cumulative Horizontal Radiance
Statistical Dimension: Select
dim_sensor
Period: Select
Beginning of Life
Metric Aggregator: Automatic generation of
SUM
based on the correlated raw metricUnit: Automatic generation of
Wh/m²
based on the correlated raw metricData Type: Select
STRING
Derived Metric ID: Select Autogenerate and generate the ID of
sumirradianceghi_dim_sensor_bol
Derived 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_power
Mapping Configuration Group Name: Enter
Cumulated_Generation_of_the_Solar_Site
Data Source Configuration
Calculation Method: Select
Fact Table Pass-Through
Fact Tables: Select
fact_solarpower
Time Field: Select
date_time
Dimension: Select
dim_solarplant
Metric Configuration:
Metric ID: Select
sumactualSolarproduction_dim_solarplant_bol
Fact 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_sensor
Mapping Configuration Group Name: Enter
Cumulative_Radiance_of_Ambient_Temperature_of_the_Site
Data Source Configuration
Calculation Method: Select
Fact Table Pass-Through
Fact Tables: Select
fact_sensor
Time Field: Select
date_time
Dimension: Select
dim_solarplant
Metric Configuration
Average Temperature Metric
Metric ID: Select
avgambienttemp_dim_sensor_td
Fact Table Field: Select
ambient_temperature
Cumulated Radiance Metric
Metric ID: Select
sumirradianceghi_dim_sensor_bol
Fact 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-Valued
Statistical Dimension: Select
dim_solarplant
ordim_sensor
Statistical Objects: Select one or more device IDs of
solar_plant
orweather_sensor
Metrics: 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