-
Notifications
You must be signed in to change notification settings - Fork 1.2k
enhancement: Optimize listZonesMetrics and listClustersMetrics call performance #10613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good but I think it can be a little simpler
plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
Outdated
Show resolved
Hide resolved
plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10613 +/- ##
============================================
- Coverage 16.01% 16.01% -0.01%
+ Complexity 13115 13112 -3
============================================
Files 5651 5651
Lines 495863 495853 -10
Branches 60049 60047 -2
============================================
- Hits 79405 79400 -5
+ Misses 407595 407590 -5
Partials 8863 8863
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12876 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
instead of Host by cluster, and then find each host by id additional: removed unused method
557d1b8 to
d995268
Compare
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12883 |
|
[SF] Trillian test result (tid-12816)
|
|
looks good, will do a quick monkey test |
|
tested both API and UI in a lab env, no strangities to be seen. |
Description
This PR optimizes the way the hosts are retrieved from the database to speed up
listZonesMetricsandlistClustersMetricscalls on large (and slow) databases.Instead of retrieving the Host objects by the cluster, and then retrieving HostJoinVO for every host which results to SQL queries
SELECT ... FROM host_view WHERE host.id = <id>, it retrieves the list of HostJoinVO by cluster and the host type.Additionally, it removes the method
private Double findRatioValue(final String value)as it seems to be unused.Here are the test results for a big loaded platform with 200 hosts:
A mgmt server with vanilla 4.20:
A mgmt server with these changes applied:
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
cmk list zonesmetrcsandcmk list clustersmetricson both unpatched and patched mgmt servers, measured the time it required to run.cpumaxdeviation,cpuused,memorymaxdeviation,memoryused, which almost matched. After closer look I found that these fields are coming from StatsCollector, which is a map that seems to be populated individually on every mgmt server. Therefore, I assume it is normal.How did you try to break this feature and the system with this change?
This change only affects a very limited scope of the code (a for-loop), therefore it should be good as long as it compiles.