Skip to content

runtime: add runtime/metrics Read support#1907

Open
zhouguangyuan0718 wants to merge 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:runtime-metrics-read
Open

runtime: add runtime/metrics Read support#1907
zhouguangyuan0718 wants to merge 1 commit into
xgo-dev:mainfrom
zhouguangyuan0718:runtime-metrics-read

Conversation

@zhouguangyuan0718
Copy link
Copy Markdown
Contributor

Summary

  • add an LLGo source patch for runtime/metrics.Read
  • preserve standard Go metric ValueKinds while returning zero defaults for unsupported values
  • read the observable memory subset from runtime.MemStats
  • move coverage to test/std/runtime/metrics so both go test and llgo test exercise it

Tests

  • go test ./test/std/runtime/metrics -count=1
  • go test ./internal/build -run 'TestBuildSourcePatchOverlayForGo126Payloads|TestApplySourcePatchForPkg' -count=1\n- ./dev/llgo.sh test ./test/std/runtime/metrics\n- git diff --check HEAD~1..HEAD

Implement an LLGo source patch for runtime/metrics.Read so standard Go metrics keep their documented ValueKind while unsupported values default to zero.

Use runtime.MemStats directly for the subset LLGo can observe and move coverage from the cl/_testgo golden runner to a go/llgo-compatible test/std/runtime/metrics package.

Signed-off-by: ZhouGuangyuan <zhouguangyuan.xian@gmail.com>
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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