The metrics object Metrics is used by the **$Build**object and provides access to metrics logged by stage actions. These may be numbers, percentages or timings and are accessed via one of the following categories
| Name | Description |
|---|---|
| Compiler | Category for accessing compiler totals recorded by the MSBuild logger |
| OpenCover | Category for accessing unit test coverage metrics recorded by the OpenCover action |
| UnitTests | Category for accessing unit tests totals and timings recorded by unit test actions |
| Name | Description | Type | Usage Example | |
|---|---|---|---|---|
| Error | The total number of compiler errors for the current build | Integer | $Build.Metrics.Compiler.Warning$ | 5 |
| Warning | The total number of compiler warning for the current build | Integer | $Build.Metrics.Compiler.Error$ | 5 |
| Name | Description | Type | Usage Example | |
|---|---|---|---|---|
| BranchCoverage | The total branch coverage number for the current build | Number | $Build.Metrics.OpenCover.BranchCoverage$ | 60 |
| MaxCyclomaticComplexity | The maximum cyclomatic complexity number for the current build | Integer | $Build.Metrics.OpenCover.MaxCyclomaticComplexity$ | 6 |
| MinCyclomaticComplexity | The minimum cyclomatic complexity number for the current build | Integer | $Build.Metrics.OpenCover.MinCyclomaticComplexity$ | 1 |
| NumberOfBranchPoints | The total number of branch points for the current build | Integer | $Build.Metrics.OpenCover.NumberOfBranchPoints$ | 5 |
| NumberOfClasses | The total number of classes for the current build | Integer | $Build.Metrics.OpenCover.NumberOfClasses$ | 3 |
| NumberOfMethods | The total number of methods for the current build | Integer | $Build.Metrics.OpenCover.NumberOfMethods$ | 2 |
| NumberOfSequencePoints | The total number of sequence points for the current build | Integer | $Build.Metrics.OpenCover.NumberOfSequencePoints$ | 14 |
| SequenceCoverage | The total sequence coverage number for the current build | Number | $Build.Metrics.OpenCover.SequenceCoverage$ | <br>92.86<br> |
| VisitedBranchPoints | The total number of visited branch points for the current build | Integer | $Build.Metrics.OpenCover.VisitedBranchPoints$ | 3 |
| VisitedClasses | The total number of visited classes for the current build | Integer | $Build.Metrics.OpenCover.VisitedClasses$ | 2 |
| VisitedMethods | The total number of visited methods for the current build | Integer | $Build.Metrics.OpenCover.VisitedMethods$ | 2 |
| VisitedSequencePoints | The total number of visited sequence points for the current build | Integer | $Build.Metrics.OpenCover.VisitedSequencePoints$ | 13 |
| Name | Description | Type | Usage Example | |
|---|---|---|---|---|
| AverageTime | The average time taken to run each test | Time | $Build.Metrics.UnitTests.AverageTime$ | 00:00:02 |
| CaseCount | The total number of test cases | Integer | $Build.Metrics.UnitTests.CaseCount$ | 8 |
| Error | The number of tests in error | Integer | $Build.Metrics.UnitTests.Error$ | 1 |
| Failed | The number of failed tests | Integer | $Build.Metrics.UnitTests.Failed$ | 2 |
| FixedTests | The number of successful tests which were not previously successful | Integer | $Build.Metrics.UnitTests.FixedTests$ | 2 |
| FixtureCount | The total number of test fixtures | Integer | $Build.Metrics.UnitTests.FixtureCount$ | 3 |
| Ignored | The number of ignored tests | Integer | $Build.Metrics.UnitTests.Ignored$ | 1 |
| Inconclusive | The number of inconclusive tests | Integer | $Build.Metrics.UnitTests.Inconclusive$ | 1 |
| Invalid | The number of invalid tests | Integer | $Build.Metrics.UnitTests.Invalid$ | 1 |
| NewFailures | The number of failed tests which had not previously failed | Integer | $Build.Metrics.UnitTests.NewFailures$ | 2 |
| NewTests | The total number of new tests | Integer | $Build.Metrics.UnitTests.NewTests$ | 1 |
| NotRun | The number of tests not run | Integer | $Build.Metrics.UnitTests.NotRun$ | 1 |
| Passed | The number of passed tests | Integer | $Build.Metrics.UnitTests.Passed$ | 10 |
| PercentErrors | The percentage of tests with errors | Number | $Build.Metrics.UnitTests.PercentErrors$ | 30 |
| PercentFailed | The percentage of tests which failed | Number | $Build.Metrics.UnitTests.PercentFailed$ | 30 |
| PercentNotRun | The percentage of tests which were not run | Number | $Build.Metrics.UnitTests.PercentNotRun$ | 0 |
| PercentPassed | The percentage of tests which passed | Number | $Build.Metrics.UnitTests.PercentPassed$ | 30 |
| Shelved | The number of shelved tests | Integer | $Build.Metrics.UnitTests.Shelved$ | 1 |
| Skipped | The number of skipped tests | Integer | $Build.Metrics.UnitTests.Skipped$ | 1 |
| TotalTime | The total time taken to run all tests | Time | $Build.Metrics.UnitTests.TotalTime$ | 00:01:12 |