Skip to content

[Hotfix] Fetch the latest MemoryUsage inside each gauge call#4062

Merged
xxubai merged 1 commit intoapache:masterfrom
7hong:master
Jan 29, 2026
Merged

[Hotfix] Fetch the latest MemoryUsage inside each gauge call#4062
xxubai merged 1 commit intoapache:masterfrom
7hong:master

Conversation

@7hong
Copy link
Contributor

@7hong 7hong commented Jan 27, 2026

Why are the changes needed?

Brief change log

The registerHeapMetric method only reads the JVM heap usage once at registration time and then reuses that snapshot inside the gauges, which causes the heap metrics to never change after being registered.

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@github-actions github-actions bot added the module:ams-server Ams server module label Jan 27, 2026
@7hong 7hong changed the title [Hotfix] Fetch the latest MemoryUsage inside each gauge call. [Hotfix] Fetch the latest MemoryUsage inside each gauge call Jan 27, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.64%. Comparing base (cad9869) to head (3c0451c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4062      +/-   ##
============================================
- Coverage     28.79%   28.64%   -0.16%     
+ Complexity     3944     3935       -9     
============================================
  Files           657      653       -4     
  Lines         52431    52276     -155     
  Branches       6664     6622      -42     
============================================
- Hits          15098    14972     -126     
+ Misses        36226    36211      -15     
+ Partials       1107     1093      -14     
Flag Coverage Δ
core 28.64% <100.00%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xxubai xxubai merged commit b61383b into apache:master Jan 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants