Skip to content

CICD-470 · Cost-performance regression gate ​

Encyclopedia · FinOps and resource optimization · All snippets

Previous · CICD-469 · Next · CICD-471

1. Where it fits ​

  • Placement In the benchmark release gate after cost and throughput have been calculated for both runs.
  • Prerequisites authorized read reports, explicit pricing period and reviewed ownership for cleanup.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
jq -es '.[0] as $base | .[1] as $now | $now.completed >= $base.completed and $now.p99_ttft_ms <= 1.15*$base.p99_ttft_ms and $now.cost_per_million <= $base.cost_per_million' baseline.json candidate.json

3. How it works ​

The gate combines completion, tail latency and cost per million tokens. All constraints must hold for promotion to continue.

A useful cost gain must preserve completion and latency targets.

flowchart TD
  N1["Baseline cost and latency"]
  N2{"All policy limits pass"}
  N1 --> N2
  N3["Candidate cost and latency"]
  N3 --> N2
  N4["Candidate qualifies"]
  N2 -->|Yes| N4
  N5["Reject candidate"]
  N2 -->|No| N5

4. Verify the result ​

Compare equal request rates, workloads, currencies and GPU prices, then fail on slower latency or higher unit cost.

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