Main Content

getAvailableMetricIds

Return metric identifiers for available metrics

Description

example

availableMetricIds = getAvailableMetricIds(metricEngine) returns the metric identifiers for the metrics available for the specified metricEngine object. By default, the list includes only the metrics available with the current installation.

example

availableMetricIds = getAvailableMetricIds(metricEngine,'App','DesignCostEstimation') returns the metric identifiers for design cost estimation metrics. For an additional syntax to display metric identifiers for requirements-based model metrics, see getAvailableMetricIds (Simulink Check).

example

availableMetricIds = getAvailableMetricIds(___,'Installed',installationStatus) returns the metric identifiers filtered by the installation status specified by installationStatus. For example, specifying installationStatus as false returns the metric identifier for each available metric, even if the associated MathWorks® products are not currently installed on your machine.

Examples

collapse all

Create a metric.Engine object and view all metrics available with the current installation.

metric_engine = metric.Engine();
ids = getAvailableMetricIds(metric_engine)
ids = 

  1×29 string array

  Columns 1 through 6

    "ConditionCoverage…"    "ConditionCoverage…"    "DataSegmentEstimate"    "DecisionCoverageB…"    "DecisionCoverageF…"    "ExecutionCoverage…"

  Columns 7 through 12

    "ExecutionCoverage…"    "MCDCCoverageBreak…"    "MCDCCoverageFragm…"    "OperatorCount"    "RequirementWithTe…"    "RequirementWithTe…"

  Columns 13 through 19

    "RequirementWithTe…"    "RequirementsPerTe…"    "RequirementsPerTe…"    "TestCaseStatus"    "TestCaseStatusDis…"    "TestCaseStatusPer…"    "TestCaseTag"

  Columns 20 through 25

    "TestCaseTagDistri…"    "TestCaseType"    "TestCaseTypeDistr…"    "TestCaseVerificat…"    "TestCaseVerificat…"    "TestCaseWithRequi…"

  Columns 26 through 29

    "TestCaseWithRequi…"    "TestCaseWithRequi…"    "TestCasesPerRequi…"    "TestCasesPerRequi…"

Create a metric.Engine object and view all design cost metrics available.

metric_engine = metric.Engine();
ids = getAvailableMetricIds(metric_engine,...
    'App','DesignCostEstimation',...
    'Installed',false)
ids = 

  1×2 string array

    "DataSegmentEstimate"    "OperatorCount"

Input Arguments

collapse all

Metric engine object for which to collect metric results, specified as a metric.Engine object.

Filter for metric installation status, specified as one of these values:

  • 1 (true) — Returns only metric identifiers associated with the MathWorks products currently installed on your machine.

  • 0 (false) — Returns metric identifiers for each available metric, even if the associated MathWorks products are not currently installed on your machine.

Example: false

Data Types: logical

Output Arguments

collapse all

Metric identifiers for available metrics, returned as a string or string array. For a list of design cost metrics and their identifiers, see Design Cost Model Metrics. For a list of requirements-based model testing metrics and their identifiers, see Model Testing Metrics (Simulink Check).

Example: "DataSegmentEstimate"

Example: ["ConditionCoverageBreakdown","DataSegmentEstimate" "DecisionCoverageBreakdown", "ExecutionCoverageBreakdown", "MCDCCoverageBreakdown", "OperatorCount", "RequirementWithTestCaseDistribution", "RequirementWithTestCasePercentage", "RequirementsPerTestCaseDistribution", "TestCaseStatusDistribution", "TestCaseStatusPercentage", "TestCaseTagDistribution", "TestCaseTypeDistribution", "TestCaseVerificationStatusDistribution", "TestCaseWithRequirementDistribution", "TestCaseWithRequirementPercentage", "TestCasesPerRequirementDistribution"]

Version History

Introduced in R2022a