Skip to content

CICD-498 · Change lead time measurement ​

Encyclopedia · Pipeline governance and operational management · All snippets

Previous · CICD-497 · Next · CICD-499

1. Where it fits ​

  • Placement delivery metrics report.
  • Prerequisites trusted policy checkout and normalized deployment events with scoped access.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
jq -s '[.[] | select(.commit_at and .production_at) | (.production_at|fromdateiso8601)-(.commit_at|fromdateiso8601)] | sort | {samples:length, median_seconds:(.[(length/2|floor)])}' lead-times.jsonl

3. How it works ​

The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

Normalize timestamps and retain per-change samples. The example uses the upper median for even sample counts.

Validation syntax-validated (Bash parse). Status definitions.