From b4629ad33ae570c245b297546b3d0bb449f3f5d1 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 25 Aug 2023 12:49:49 +0530 Subject: [PATCH 1/2] ui: speed up compute instance listing The default listVirtualMachinesMetrics APIs assumings details=all which isn't really used in the list view. By changing this to a subset of details, we can see gains upto 10x in listing speed in the UI. When moving to the resource/detail view of the UI, don't pass state or details so `all` the details of the instance are returned. Signed-off-by: Rohit Yadav --- ui/src/config/section/compute.js | 4 ++-- ui/src/store/mutation-types.js | 1 + ui/src/views/AutogenView.vue | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index e9a16ff6322b..007bd8c3f9d5 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -32,9 +32,9 @@ export default { permission: ['listVirtualMachinesMetrics'], resourceType: 'UserVm', params: () => { - var params = {} + var params = { details: 'servoff,tmpl,nics' } if (store.getters.metrics) { - params = { state: 'running' } + params = { details: 'servoff,tmpl,nics,stats' } } return params }, diff --git a/ui/src/store/mutation-types.js b/ui/src/store/mutation-types.js index bbc27ef1b1a9..0fe4a104958e 100644 --- a/ui/src/store/mutation-types.js +++ b/ui/src/store/mutation-types.js @@ -37,6 +37,7 @@ export const DOMAIN_STORE = 'DOMAIN_STORE' export const DARK_MODE = 'DARK_MODE' export const VUE_VERSION = 'VUE_VERSION' export const CUSTOM_COLUMNS = 'CUSTOM_COLUMNS' +export const RELOAD_ALL_PROJECTS = 'RELOAD_ALL_PROJECTS' export const CONTENT_WIDTH_TYPE = { Fluid: 'Fluid', diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index 4bc0c43616f2..e3ef86d1cb5a 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -858,6 +858,11 @@ export default { delete params.showunique } + if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) { + delete params.state + delete params.details + } + this.loading = true if (this.$route.params && this.$route.params.id) { params.id = this.$route.params.id From c10873e77d2983b6a8b231d162a4f4b18894d145 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 25 Aug 2023 17:03:38 +0530 Subject: [PATCH 2/2] Update AutogenView.vue --- ui/src/views/AutogenView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index e3ef86d1cb5a..a3d62a9bebee 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -859,7 +859,6 @@ export default { } if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) { - delete params.state delete params.details }