Displaying Statistics from a Build
If you use LogScale to monitor how your software is building, your build pipeline might already output the numbers you want, like the number of failed tests. Instead of calculating this number based on the failed tests that have been logged, you can display the number the system has given you:
logscale
commit = 67686a1
| /Tests failed: (?<tests_failed>\d+)/
| select(tests_failed)
Assuming there is only one build per commit, this search extracts the
number of tests that failed in the build, and uses the
select()
function to remove extraneous fields
from the row. Without calling select()
, the row
might contain multiple numeric fields, and the Single
Value
widget would not know what to display.