Skip to content

Commit b4629ad

Browse files
committed
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 <[email protected]>
1 parent 3c38ed7 commit b4629ad

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,11 @@ export default {
858858
delete params.showunique
859859
}
860860
861+
if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) {
862+
delete params.state
863+
delete params.details
864+
}
865+
861866
this.loading = true
862867
if (this.$route.params && this.$route.params.id) {
863868
params.id = this.$route.params.id

0 commit comments

Comments
 (0)