shwstppr opened a new pull request, #6803: URL: https://github.com/apache/cloudstack/pull/6803
### Description This PR improves resource metrics/stats visualization functionality. It allows stats for: **System VMs** Persisting and showing stats for system VMs. New API - `listSystemVmsUsageHistory` has been added to support this. SSVM, CPVM and VRs now show `Statistics` tab similar to user VMs. System VM stats will be stored in the existing DB table `cloud.vm_stats` and will use the same cleanup mechanism as the user VMs. To control storing system VM stats a new global setting has been added, `vm.stats.user.vm.only` - When set to 'false' stats for system VMs will be collected otherwise stats collection will be done only for user VMs. The default value is 'false' **VM Disks** Persisting and showing stats for VM disks. New API - `listVolumesUsageHistory` has been added to support this. Volumes attached to a running user VM show the `Statistics` tab. VM disks stats will be stored in a new DB table `cloud.volume_stats`. To control storing VM disk stats two new global setting have been added, `vm.disk.stats.retention.enabled` - When set to 'true' stats for VM disks will be stored in the database otherwise disk stats will not be stored. The default value is 'false'. `vm.disk.stats.max.retention.time` - The maximum time (in minutes) for keeping Volume stats records in the database. The VM stats cleanup process will be disabled if this is set to 0 or less than 0. The default value is 720. Improvements have been made to the Statistics tab wrt to time filtering and display. Order for statistics for an instance is now - CPU, memory, disks, network. Also, the default value for the global setting - `vm.stats.max.retention.time` has been increased to `720` or 12 hours for more meaningful representation in the UI. Based on tests VM stats DB storage will be in the order of,  Therefore, with a default VM stat interval of 1min, 12 hours stats may make sense. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [ ] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. --> <!-- Include details of your testing environment, and the tests you ran to --> <!-- see how your change affects other areas of the code, etc. --> <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
