cirrus-ci-docs
cirrus-ci-docs copied to clipboard
Support Arbitrarily Repository Metrics
Description
In addition to #93 it will be nice to expose an ability for users to expose arbitrary metrics like code coverage, benchmark score, amount of TODOs, etc.
Context
Cirrus can comment on PRs with comparison of such stats with the base of the PR. Plus expose badges.
Each stat should have properties like:
unitto define if it's a percent or an absolute numbermerge_strategyto define how to merge stats with the same name from different tasks. Eitheroverrideoraverage(which might be useful for benchmarking: run couple of tasks in parallel and take the average).
Syntax might look like this:
on_success:
metric:
name: performance
unit: seconds
merge_strategy: average
value_script: cat benchmarking/performance.txt
Yes, this sounds so cool!
on_success would be a key under task, right? If so, the metric name should be concatenated with the task name by default, and merging of metrics across tasks should only be done if requested.
I recently found https://seriesci.com/ for an app that implements something like this in an orthogonal way.
Interesting! Will keep an eye on @seriesci! Thanks for sharing!
I was thinking about scoping metrics by build (aka SHA). That's why there is merge_strategy to merge metrics of the same name produced by different tasks within a build (you can run benchmark several times and take an average as a result).