Skip to content

BUILD-11593 Render CPU request as the avg denominator (schema 3) - #304

Merged
mikolaj-matuszny-ext-sonarsource merged 2 commits into
masterfrom
BUILD-11593-cpu-request-denominator
Jun 19, 2026
Merged

BUILD-11593 Render CPU request as the avg denominator (schema 3)#304
mikolaj-matuszny-ext-sonarsource merged 2 commits into
masterfrom
BUILD-11593-cpu-request-denominator

Conversation

@mikolaj-matuszny-ext-sonarsource

@mikolaj-matuszny-ext-sonarsource mikolaj-matuszny-ext-sonarsource commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Consume the new cgroup.cpu.request_cores field (metrics schema_version 3) so the CI Metrics report shows / N cores requested on burstable ARC runners instead of the misleading node-wide nproc value (e.g. / 32 cores on a sonar-xs).

Ticket: BUILD-11593 · Producer PR: SonarSource/github-runners-infra#423

Changes

  • report-ci-metrics/lib.sh (_rci_cpu_cell): denominator preference is now limit → request (requested) → online_count (available) → bare cores.
  • ci-metrics/job-completed.sh: synced producer-hook copy — emits request_cores, schema 2 → 3, request-based denominator. (Differs from the infra copy only in the pre-existing feature-gate section.)
  • Tests: 4 new _rci_cpu_cell tier cases (limit / request-is-the-fix / WarpBuild available / bare); fixtures bumped to schema 3.

Testing

40 examples, 0 failures; report-ci-metrics/lib.sh + orchestrator at 100% coverage (dockerized kcov). shellcheck clean.

The key regression test asserts the ARC case renders 0.07 / 1 cores requested (7%) — i.e. the request, not nproc.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 16, 2026

Copy link
Copy Markdown

BUILD-11593

Comment thread ci-metrics/job-completed.sh
Comment thread report-ci-metrics/lib.sh Outdated
@mikolaj-matuszny-ext-sonarsource
mikolaj-matuszny-ext-sonarsource force-pushed the BUILD-11593-cpu-request-denominator branch from c95f3df to bc8e6af Compare June 18, 2026 15:14
Consume the new cgroup.cpu.request_cores field (schema_version 3) so the
report shows "/ N cores requested" on burstable ARC runners instead of the
node-wide nproc value. Denominator preference in _rci_cpu_cell: limit ->
request -> online_count ("available") -> bare cores.

Also sync the producer hook copy (ci-metrics/job-completed.sh) with the
source in github-runners-infra: emit request_cores, bump schema to 3, and
use the request as the no-limit denominator.

Tests: 4 new _rci_cpu_cell tier cases; fixtures bumped to schema 3. 40
examples, 100% coverage.
…erence spec for synced hook

- Remove BUILD-11593 references from inline comments across the changed files.
- Cross-reference the _rci_cpu_cell spec from the producer hook's CPU-avg block so
  the hand-synced duplicate rendering stays pinned and can't drift unnoticed.
@mikolaj-matuszny-ext-sonarsource
mikolaj-matuszny-ext-sonarsource force-pushed the BUILD-11593-cpu-request-denominator branch from bc8e6af to db00909 Compare June 19, 2026 09:07
@sonarqubecloud

Copy link
Copy Markdown

@mikolaj-matuszny-ext-sonarsource
mikolaj-matuszny-ext-sonarsource merged commit 7f74370 into master Jun 19, 2026
17 checks passed
@mikolaj-matuszny-ext-sonarsource
mikolaj-matuszny-ext-sonarsource deleted the BUILD-11593-cpu-request-denominator branch June 19, 2026 09:10
@gitar-bot

gitar-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Updates CI metrics to use the CPU request as the denominator in schema 3 for accurate ARC runner reporting. Ensure the newly added request-denominator branch in job-completed.sh is included in the test suite.

✅ 1 resolved
Quality: New request-denominator branch in job-completed.sh is untested

📄 ci-metrics/job-completed.sh:377-381 📄 spec/report-ci-metrics_spec.sh:292-306
The new tier cases were added to _rci_cpu_cell in report-ci-metrics/lib.sh and are well covered by 4 new spec examples. However, the parallel display logic added to the producer hook ci-metrics/job-completed.sh (the elif request branch at lines 377-381 that renders "/ N cores requested (P%)") has no corresponding test — there is no spec/ file exercising job-completed.sh at all. Because the two implementations are hand-synced duplicates, they can silently drift (e.g. rounding, percentage formula, or precedence differences) without any test catching it. This is a minor/testing concern: consider adding a focused test for the producer's v_cpu_avg request branch, or at least a comment cross-referencing the lib.sh spec that pins the expected rendering so the duplication stays in sync.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants