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>
This commit is contained in:
Rohit Yadav 2023-08-25 17:27:44 +05:30 committed by GitHub
parent 6f7725ab35
commit 93bd5b7a69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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
},

View File

@ -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',

View File

@ -862,6 +862,10 @@ export default {
delete params.showunique
}
if (['listVirtualMachinesMetrics'].includes(this.apiName) && this.dataView) {
delete params.details
}
this.loading = true
if (this.$route.params && this.$route.params.id) {
params.id = this.$route.params.id