Metric-ImportRFGMetricAttribute¶
Import an RFG attribute
Required inputs: RFG
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¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
This rule shares the following common metric options: base_view_name, excluded_node_types, hierarchy_edge_name, hierarchy_view_name, propagate, report_all_values, report_propagated_values
The following places define options that affect this rule: Analysis-GlobalOptions
display_name¶
display_name : str | None = None
max_value¶
max_value : float | None = None
min_value¶
min_value : float | None = None
rfg_metric_name¶
rfg_metric_name : str = ''
rulehtml_description¶
rulehtml_description
HTML documentation for the rule, without header or configuration section. This is used when generating the stylecheck documentation.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>'