redline metrics

Collect review telemetry and build the dashboard, digest, inbox and ROI pages.

Eight subcommands that measure Redline across the organisation. collect pulls review outcomes for merged pull requests; dashboard, digest, inbox and roi build pages from them; baseline records the starting figures; correlate is a research tool; score-seeds scores a reviewer against the seeded corpus. Scheduled workflows run most of them. Run one by hand to reproduce a scheduled run that looks wrong.

Where it runs: collect, dashboard, digest, roi and correlate run in the metrics repository, through the published package. inbox runs in the source repository. baseline runs once from a maintainer's terminal. score-seeds runs anywhere. Each subcommand's --help says where it runs, and every option can also be set as an environment variable.

Synopsis

synopsis
redline metrics <command> [options]
redline metrics <command> --help

Flags

FlagDefaultWhat it does
collectPull review outcomes for merged pull requests across the org. --org (required), --days (8), --since, --out (data), --dry-run, --skip-sarif, --token.
dashboardBuild the telemetry dashboard page. --org (required), --data (data), --days (90), --out (dist), --registry (registry.json), --seed-scores, --onboarded, --standards-version.
digestBuild the weekly digest as an Adaptive Card. --org (required), --data, --days (7), --out (stdout), --open-prs, --stale-prs, --seed-scores, --dashboard-url.
inboxBuild the org-wide prioritised pull request inbox. --org (required), --out (dist), --max-pages (10), --token.
baselineCompute the baseline later phases are measured against. --data, --org, --registry, --days (90), --out (baseline.json), --spend-total, --spend-currency (USD), --spend-grain (org).
roiBuild the page that sets review cost against what it caught. --data, --days (90), --out (roi.json), --html (roi.html), --spend-total, --spend-currency, --spend-grain (org), --spend-source.
correlateResearch: whether ignoring a finding cost anything later. --data, --days (180), --window-days (30), --min-sample (10), --out (correlation.json).
score-seedsScore a reviewer against the seeded corpus on a pull request. --repo and --pr (required), --window (4), --history, --baseline, --json, --token.

--help prints the same list from the CLI you have installed.

Examples

List the subcommands

terminal
$ npx redlinegate@latest metrics

redline metrics <command>

  collect        pull review outcomes for merged pull requests across the org
  dashboard      build the telemetry dashboard page
  digest         build the weekly stakeholder digest as an Adaptive Card
  inbox          build the org-wide prioritised pull request inbox
  baseline       compute the baseline every roadmap phase is measured against
  roi            build the page that says what review cost against what it caught
  correlate      research: whether ignoring a finding cost anything
  score-seeds    score an automated reviewer against the seeded corpus

Run `redline metrics <command> --help` for its flags.

Reproduce the scheduled collection and dashboard, in the metrics repository

terminal
$ GH_TOKEN=<org-read-token> npx redlinegate@latest metrics collect --org acme --days 8 --out data
$ npx redlinegate@latest metrics dashboard --org acme --data data --out dist

Exit codes

CodeMeaning
0Success.
2No subcommand, an unknown option, a missing required option, or a value of the wrong type.
4The run itself failed, for example on a bad token or an unreadable data file.