Skip to content

Only request metric collections for hosts connected to the MS#13561

Open
GaOrtiga wants to merge 1 commit into
apache:4.20from
scclouds:metric_collection_hosts_connected_MS
Open

Only request metric collections for hosts connected to the MS#13561
GaOrtiga wants to merge 1 commit into
apache:4.20from
scclouds:metric_collection_hosts_connected_MS

Conversation

@GaOrtiga

@GaOrtiga GaOrtiga commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Currently, KVM metric collections are performed for each Management Server independently. This process sends command to the Agents, requesting a collection of VM metrics. The Agent receives the command, collects the current metrics, compares it with the previous collection, and sends the final results to the MS that requested the metrics. Finally, the MS saves the data to the DB.

The new metrics are compared to the previous metrics collected, regardless of the MS that triggered the process. Thus, the collection interval depends on the interval between the Management Servers, and not the interval defined in the configuration. This does not affect the authenticity of the data, however, it disregards the configured timeout.

To prevent this situation, the source code has been adjusted, guaranteeing that the MS only sends metric collection commands to hosts connected to it.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

  • In an environment with two MSs, I verified that VM metric collection occured normally for the VMs on hosts connected to the MS.
  • For the remaining hosts, the collection did not occur.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.26%. Comparing base (c8b7816) to head (8fcffc9).

Files with missing lines Patch % Lines
...src/main/java/com/cloud/server/StatsCollector.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13561      +/-   ##
============================================
- Coverage     16.26%   16.26%   -0.01%     
+ Complexity    13437    13436       -1     
============================================
  Files          5667     5667              
  Lines        500676   500679       +3     
  Branches      60799    60800       +1     
============================================
- Hits          81420    81412       -8     
- Misses       410150   410160      +10     
- Partials       9106     9107       +1     
Flag Coverage Δ
uitests 4.14% <ø> (ø)
unittests 17.11% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant