Return metric identifiers for available metrics
For example, this code returns the metric identifiers for the Model Testing Dashboard:
availableMetricIds = getAvailableMetricIds(metricEngine,... 'App','DashboardApp',... 'Dashboard','ModelUnitTesting');
For an additional syntax to display metric identifiers for design cost estimation, see
getAvailableMetricIds (Fixed-Point Designer).
For example, specifying
false allows you to return the metric identifiers for each of the
available metrics, even if the associated MathWorks® products are not currently installed on your machine.
Collect Metrics for Testing Artifacts in a Project
Collect metric data on the requirements-based testing artifacts in a project.
Open a project that includes the models and testing files. At the command prompt,
metric.Engine object for the project.
metric_engine = metric.Engine();
Update the trace information for
ensure that the artifact information is up to
Create a list of the available metric identifiers for the Model Testing
Dashboard by specifying the dashboard identifier as
metric_ids = getAvailableMetricIds(metric_engine,... 'App','DashboardApp',... 'Dashboard','ModelUnitTesting');
Collect results by executing the metric engine on the list of metric identifiers.
metricEngine — Metric engine object
Metric engine object for which you want to collect metric results, specified as a
dashboardIdentifier — Dashboard identifier
Identifier for the dashboard, specified as one of these values:
'ModelUnitTesting'— Return the model testing metric identifiers associated with your project.
'ModelMaintainability'— Return each of the model maintainability metric identifiers.
installationStatus — Filter for metric installation status
true) (default) |
Filter for metric installation status, specified as one of these values:
true) — Returns only metric identifiers associated with the MathWorks products currently installed on your machine.
false) — Returns metric identifiers for each of the available metrics, even if the associated MathWorks products are not currently installed on your machine. You can use the list of each of the available metric identifiers to access the metric data collected on a different machine.
availableMetricIds — Metric identifiers
string | string array
Metric identifiers for the available metrics, returned as a string or string array. For a list of model testing metrics and their identifiers, see Model Testing Metrics.
"TestCaseStatusPercentage", "TestCaseTagDistribution", "TestCaseTypeDistribution",
Version HistoryIntroduced in R2021b
R2022a: Output includes metrics from the Model Testing Dashboard app and Design Cost Estimation app
The output includes metrics from both the Model Testing Dashboard app and the Design Cost Estimation app if you:
Have Fixed-Point Designer™ installed on your machine.