Skip to content

Commit 93bd5b7

Browse files
authored
ui: speed up compute instance listing (#7911)
* 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 <rohit.yadav@shapeblue.com> * Update AutogenView.vue --------- Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 6f7725a commit 93bd5b7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

ui/src/config/section/compute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export default {
3232
permission: ['listVirtualMachinesMetrics'],
3333
resourceType: 'UserVm',
3434
params: () => {
35-
var params = {}
35+
var params = { details: 'servoff,tmpl,nics' }
3636
if (store.getters.metrics) {
37-
params = { state: 'running' }
37+
params = { details: 'servoff,tmpl,nics,stats' }
3838
}
3939
return params
4040
},

ui/src/store/mutation-types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const DOMAIN_STORE = 'DOMAIN_STORE'
3737
export const DARK_MODE = 'DARK_MODE'
3838
export const VUE_VERSION = 'VUE_VERSION'
3939
export const CUSTOM_COLUMNS = 'CUSTOM_COLUMNS'
40+
export const RELOAD_ALL_PROJECTS = 'RELOAD_ALL_PROJECTS'
4041

4142
export const CONTENT_WIDTH_TYPE = {
4243
Fluid: 'Fluid',

ui/src/views/AutogenView.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,10 @@ export default {
862862
delete params.showunique
863863
}
864864
865+
if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) {
866+
delete params.details
867+
}
868+
865869
this.loading = true
866870
if (this.$route.params && this.$route.params.id) {
867871
params.id = this.$route.params.id

0 commit comments

Comments
 (0)