apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2k stars 1.09k forks source link

Add minimum details parameter to Search View's listDomains #9616

Closed gpordeus closed 3 weeks ago

gpordeus commented 1 month ago

Description

This PR adds the details: min parameter to listDomains API call. Since they are used only for ids and names, more details are unnecessary and listDomains ends up taking a long time to execute when many domains exist.

In a test environment with 5000 domains, running time cmk listDomains yielded cmk listDomains 0,31s user 0,11s system 1% cpu 31,200 total, but time cmk listDomains details=min yielded cmk listDomains details=min 0,14s user 0,04s system 7% cpu 2,521 total.

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Screenshots (if appropriate):

Before: image

After: image

How Has This Been Tested?

I set up an environment with 5000 domains and unlimited page size.

I then checked the Network tab on the browser before and after the changes (see Screenshots).

Searching itself worked normally.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 15.57%. Comparing base (d7ca05e) to head (a8f1503). Report is 24 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9616 +/- ## ============================================ - Coverage 15.57% 15.57% -0.01% - Complexity 12037 12048 +11 ============================================ Files 5501 5505 +4 Lines 482219 482621 +402 Branches 62044 60641 -1403 ============================================ + Hits 75125 75175 +50 - Misses 398791 399140 +349 - Partials 8303 8306 +3 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9616/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9616/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.16% <ø> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9616/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.35% <ø> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DaanHoogland commented 4 weeks ago

@blueorangutan ui

blueorangutan commented 4 weeks ago

@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan commented 4 weeks ago

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9616 (QA-JID-437)

DaanHoogland commented 4 weeks ago

Code LGTM. I guess this should be done for other forms too

most probably, but I think we can merge this (and create an issue for the rest or a discussion to do the inventarisation)