Skip to content

report-basic: also report load average + swap size in metrics report#42594

Merged
poettering merged 1 commit into
systemd:mainfrom
poettering:more-basic-report
Jun 19, 2026
Merged

report-basic: also report load average + swap size in metrics report#42594
poettering merged 1 commit into
systemd:mainfrom
poettering:more-basic-report

Conversation

@poettering

Copy link
Copy Markdown
Member

No description provided.

@poettering poettering added this to the v262 milestone Jun 15, 2026
@poettering poettering added new-feature please-review PR is ready for (re-)review by a maintainer report labels Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Claude review of PR #42594 (a7c63c1)

The PR is in good shape — it cleanly follows the existing report-basic metric idioms (multi-field generator via mf + i, .generate = NULL trailing entries, assert_cc sync invariant, GAUGE types, metric_build_send_double mirroring the existing helpers). Numeric conversions (fixed-point load average, 64-bit swap multiplication) and memory/lifetime handling are correct. Both previously-flagged items have been addressed in this revision.

Suggestions

  • Test crashes on CONFIG_SWAP=n kernelstest/units/TEST-74-AUX-UTILS.report.sh:81 — missing SwapTotal: makes $(( * 1024 )) a bash syntax error instead of passing.

Nits

  • Use MUL_SAFE for swap byte productsrc/report/report-basic.c:197 — codebase convention for the count * unit pattern (see physical_memory() in limits-util.c).
  • basic_value() helper has a single call sitetest/units/TEST-74-AUX-UTILS.report.sh:74 — the load-average loop reimplements the same jq pipeline inline instead of reusing the helper.

Workflow run

Comment thread test/units/TEST-74-AUX-UTILS.report.sh
Comment thread src/report/report-basic.c Outdated
@bluca bluca added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels Jun 15, 2026
@poettering poettering added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Jun 16, 2026
Comment thread src/report/report-basic.c Outdated
@bluca bluca added good-to-merge/after-next-release and removed please-review PR is ready for (re-)review by a maintainer labels Jun 16, 2026
Comment thread test/units/TEST-74-AUX-UTILS.report.sh
@poettering poettering added the downstream/amutable Issues that apply to downstream amutable distribution label Jun 17, 2026
@poettering poettering merged commit 491ee4a into systemd:main Jun 19, 2026
66 of 78 checks passed
@bluca

bluca commented Jun 19, 2026

Copy link
Copy Markdown
Member

looks like this is incompatible with #42595
#42669

bluca added a commit to bluca/systemd that referenced this pull request Jun 19, 2026
Two PRs got merged at the same time, which cause a test to fail,
as they work individually but fail when combined

TEST-74-AUX-UTILS.sh[1688]: + /usr/lib/systemd/systemd-report generate io.systemd.Manager.UnitsTotal
TEST-74-AUX-UTILS.sh[1805]: {"mediaType":"application/vnd.io.systemd.report","metrics":[{"name":"io.systemd.Manager.UnitsTotal","value":249}],"timestamp":"Fri 2026-06-19 19:50:48 UTC"}
TEST-74-AUX-UTILS.sh[1806]: + /usr/lib/systemd/systemd-report generate io.systemd.Manager.UnitsTotal
TEST-74-AUX-UTILS.sh[1807]: + jq .
TEST-74-AUX-UTILS.sh[1807]: {
TEST-74-AUX-UTILS.sh[1807]:   "mediaType": "application/vnd.io.systemd.report",
TEST-74-AUX-UTILS.sh[1807]:   "metrics": [
TEST-74-AUX-UTILS.sh[1807]: {
TEST-74-AUX-UTILS.sh[1807]:   "name": "io.systemd.Manager.UnitsTotal",
TEST-74-AUX-UTILS.sh[1807]:   "value": 249
TEST-74-AUX-UTILS.sh[1807]: }
TEST-74-AUX-UTILS.sh[1807]:   ],
TEST-74-AUX-UTILS.sh[1807]:   "timestamp": "Fri 2026-06-19 19:50:48 UTC"
TEST-74-AUX-UTILS.sh[1807]: }
TEST-74-AUX-UTILS.sh[1688]: + /usr/lib/systemd/systemd-report upload --url=http://localhost:8089/
TEST-74-AUX-UTILS.sh[1808]: Failed to normalize report JSON: Wrong medium type

systemd#42594
systemd#42595

Disable normalization for now, and track the issue at
systemd#42669

Follow-up for 3c2f7c6
bluca added a commit that referenced this pull request Jun 20, 2026
Two PRs got merged at the same time, which cause a test to fail,
as they work individually but fail when combined

TEST-74-AUX-UTILS.sh[1688]: + /usr/lib/systemd/systemd-report generate io.systemd.Manager.UnitsTotal
TEST-74-AUX-UTILS.sh[1805]: {"mediaType":"application/vnd.io.systemd.report","metrics":[{"name":"io.systemd.Manager.UnitsTotal","value":249}],"timestamp":"Fri 2026-06-19 19:50:48 UTC"}
TEST-74-AUX-UTILS.sh[1806]: + /usr/lib/systemd/systemd-report generate io.systemd.Manager.UnitsTotal
TEST-74-AUX-UTILS.sh[1807]: + jq .
TEST-74-AUX-UTILS.sh[1807]: {
TEST-74-AUX-UTILS.sh[1807]:   "mediaType": "application/vnd.io.systemd.report",
TEST-74-AUX-UTILS.sh[1807]:   "metrics": [
TEST-74-AUX-UTILS.sh[1807]: {
TEST-74-AUX-UTILS.sh[1807]:   "name": "io.systemd.Manager.UnitsTotal",
TEST-74-AUX-UTILS.sh[1807]:   "value": 249
TEST-74-AUX-UTILS.sh[1807]: }
TEST-74-AUX-UTILS.sh[1807]:   ],
TEST-74-AUX-UTILS.sh[1807]:   "timestamp": "Fri 2026-06-19 19:50:48 UTC"
TEST-74-AUX-UTILS.sh[1807]: }
TEST-74-AUX-UTILS.sh[1688]: + /usr/lib/systemd/systemd-report upload --url=http://localhost:8089/
TEST-74-AUX-UTILS.sh[1808]: Failed to normalize report JSON: Wrong medium type

#42594
#42595

Disable normalization for now, and track the issue at
#42669

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

Labels

Development

Successfully merging this pull request may close these issues.

2 participants