Metric-ImportRFGMetricAttribute

Import an RFG attribute

Required inputs: RFG

Imports an integer/float RFG node attribute as metric value.

To schedule import of several metrics (e.g. after importing them via Metric-ImportCSV), the following script can be added as a Python layer to the project configuration:

# Example configuration layer to easily import metrics into the Dashboard.
# This is helpful for metrics imported during the CI run with `Metric-ImportCSV`.

import axivion.config

def create_report_rules(a, base_view_name: str, *rfg_metric_names: str):
    for rfg_metric_name in rfg_metric_names:
        a.copy(
            "Metric-ImportRFGMetricAttribute",
            f"Metric-Import_{rfg_metric_name}",
            base_view_name=base_view_name,
            propagate=False,
            report_all_values=True,
            rfg_metric_name=rfg_metric_name,
        )

analysis = axivion.config.get_analysis()

# Call to create rules to report the metric values.
# Adapt the arguments `base_view_name` and `*rfg_metric_names` to your needs.
create_report_rules(
    analysis,
    analysis["Metric-ImportCSV"].view_name,
    "MyImportedMetric1",
    "MyImportedMetric2",
    "MyImportedMetric3",
    # ...
)

Possible Messages

This rule has no predefined messages.

Options

display_name

display_name : str | None = None

Description of the metric shown in the dashboard. If None, rfg_metric_name is used.
 

max_value

max_value : float | None = None

Maximum allowed value. None if unlimited.
 

min_value

min_value : float | None = None

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = ''

Name of the node attribute storing the metric value in the RFG.
 

rulehtml_description

rulehtml_description

Type: str

Default: 'Imports an integer/float RFG node attribute as metric value.n    <p>To schedule import of several metrics (e.g. after importing them vian    <a href="#Metric-ImportCSV"><code>Metric-ImportCSV</code></a>), the following scriptn    can be added as a Python layer to the project configuration:</p>n<pre># Example configuration layer to easily import metrics into the Dashboard.n# This is helpful for metrics imported during the CI run with `Metric-ImportCSV`.nnimport axivion.confignndef create_report_rules(a, base_view_name: str, *rfg_metric_names: str):n    for rfg_metric_name in rfg_metric_names:n        a.copy(n            "Metric-ImportRFGMetricAttribute",n            f"Metric-Import_{rfg_metric_name}",n            base_view_name=base_view_name,n            propagate=False,n            report_all_values=True,n            rfg_metric_name=rfg_metric_name,n        )nnanalysis = axivion.config.get_analysis()nn# Call to create rules to report the metric values.n# Adapt the arguments `base_view_name` and `*rfg_metric_names` to your needs.ncreate_report_rules(n    analysis,n    analysis["Metric-ImportCSV"].view_name,n    "MyImportedMetric1",n    "MyImportedMetric2",n    "MyImportedMetric3",n    # ...n)</pre>'

HTML documentation for the rule, without header or configuration section. This is used when generating the stylecheck documentation.