Skip to content

Commit

Permalink
Optimize getting counts of vms and pools in system
Browse files Browse the repository at this point in the history
  • Loading branch information
Qubad786 committed Aug 30, 2024
1 parent dfbf5da commit e938d8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/middlewared/middlewared/plugins/reporting/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from middlewared.service import accepts, Service
from middlewared.schema import Str, Dict, Int
from middlewared.utils.cpu import cpu_info
from middlewared.utils.zfs import query_imported_fast_impl

from .netdata import ClientConnectError, Netdata
from .utils import calculate_disk_space_for_netdata, get_metrics_approximation, TIER_0_POINT_SIZE, TIER_1_POINT_SIZE
Expand Down Expand Up @@ -52,8 +53,8 @@ def calculated_metrics_count(self):
len(self.middleware.call_sync('device.get_disks', False, True)),
cpu_info()['core_count'],
self.middleware.call_sync('interface.query', [], {'count': True}),
self.middleware.call_sync('zfs.pool.query', [], {'count': True}),
self.middleware.call_sync('vm.query', [], {'count': True}),
len(query_imported_fast_impl()),
self.middleware.call_sync('datastore.query', 'vm.vm', [], {'count': True}),
len(glob.glob('/sys/fs/cgroup/**/*.service')),
)

Expand Down

0 comments on commit e938d8b

Please sign in to comment.