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

Categories

NameDescription
CompilerCategory for accessing compiler totals recorded by the MSBuild logger
OpenCoverCategory for accessing unit test coverage metrics recorded by the OpenCover action
UnitTestsCategory for accessing unit tests totals and timings recorded by unit test actions


Compiler Metrics

NameDescriptionTypeUsage Example
ErrorThe total number of compiler errors for the current build Integer$Build.Metrics.Compiler.Warning$5
WarningThe total number of compiler warning for the current build Integer$Build.Metrics.Compiler.Error$5


OpenCover Metrics

NameDescriptionTypeUsage Example
BranchCoverageThe total branch coverage number for the current build Number$Build.Metrics.OpenCover.BranchCoverage$60
MaxCyclomaticComplexityThe maximum cyclomatic complexity number for the current buildInteger$Build.Metrics.OpenCover.MaxCyclomaticComplexity$6
MinCyclomaticComplexityThe minimum cyclomatic complexity number for the current buildInteger$Build.Metrics.OpenCover.MinCyclomaticComplexity$1
NumberOfBranchPointsThe total number of branch points for the current buildInteger$Build.Metrics.OpenCover.NumberOfBranchPoints$5
NumberOfClassesThe total number of classes for the current buildInteger$Build.Metrics.OpenCover.NumberOfClasses$3
NumberOfMethodsThe total number of methods for the current buildInteger$Build.Metrics.OpenCover.NumberOfMethods$2
NumberOfSequencePointsThe total number of sequence points for the current buildInteger$Build.Metrics.OpenCover.NumberOfSequencePoints$14
SequenceCoverageThe total sequence coverage number for the current buildNumber$Build.Metrics.OpenCover.SequenceCoverage$
92.86
VisitedBranchPointsThe total number of visited branch points for the current buildInteger$Build.Metrics.OpenCover.VisitedBranchPoints$3
VisitedClassesThe total number of visited classes for the current buildInteger$Build.Metrics.OpenCover.VisitedClasses$2
VisitedMethodsThe total number of visited methods for the current buildInteger$Build.Metrics.OpenCover.VisitedMethods$2
VisitedSequencePointsThe total number of visited sequence points for the current buildInteger$Build.Metrics.OpenCover.VisitedSequencePoints$13


UnitTest Metrics

NameDescriptionTypeUsage Example
AverageTimeThe average time taken to run each testTime$Build.Metrics.UnitTests.AverageTime$00:00:02
CaseCountThe total number of test casesInteger$Build.Metrics.UnitTests.CaseCount$8
ErrorThe number of tests in errorInteger$Build.Metrics.UnitTests.Error$1
FailedThe number of failed testsInteger$Build.Metrics.UnitTests.Failed$2
FixedTestsThe number of successful tests which were not previously successfulInteger$Build.Metrics.UnitTests.FixedTests$2
FixtureCountThe total number of test fixturesInteger$Build.Metrics.UnitTests.FixtureCount$3
IgnoredThe number of ignored testsInteger$Build.Metrics.UnitTests.Ignored$1
InconclusiveThe number of inconclusive testsInteger$Build.Metrics.UnitTests.Inconclusive$1
InvalidThe number of invalid testsInteger$Build.Metrics.UnitTests.Invalid$1
NewFailuresThe number of failed tests which had not previously failedInteger$Build.Metrics.UnitTests.NewFailures$2
NewTestsThe total number of new tests Integer$Build.Metrics.UnitTests.NewTests$1
NotRunThe number of tests not runInteger$Build.Metrics.UnitTests.NotRun$1
PassedThe number of passed testsInteger$Build.Metrics.UnitTests.Passed$10
PercentErrorsThe percentage of tests with errorsNumber$Build.Metrics.UnitTests.PercentErrors$30
PercentFailedThe percentage of tests which failedNumber$Build.Metrics.UnitTests.PercentFailed$30
PercentNotRunThe percentage of tests which were not runNumber$Build.Metrics.UnitTests.PercentNotRun$0
PercentPassedThe percentage of tests which passedNumber$Build.Metrics.UnitTests.PercentPassed$30
ShelvedThe number of shelved testsInteger$Build.Metrics.UnitTests.Shelved$1
SkippedThe number of skipped testsInteger$Build.Metrics.UnitTests.Skipped$1
TotalTimeThe total time taken to run all testsTime$Build.Metrics.UnitTests.TotalTime$00:01:12



  • No labels