Nir Soffer has posted comments on this change. Change subject: host stats: Add onlineCpus to vdsStats ......................................................................
Patch Set 4: (3 comments) https://gerrit.ovirt.org/#/c/46270/4/vdsm/virt/sampling.py File vdsm/virt/sampling.py: Line 36: from vdsm import ipwrapper Line 37: from vdsm import netinfo Line 38: from vdsm import utils Line 39: from vdsm.config import config Line 40: from vdsm import libvirtconnection Import should be sorted, this import should come after ipwrapper Line 41: import v2v Line 42: Line 43: from . import virdomain Line 44: from .utils import ExpiringCache Line 619: return None Line 620: Line 621: def get(self): Line 622: stats = self._empty_stats() Line 623: stats['onlineCpus'] = ','.join(_get_online_cpus()) Why not a list? the cpu index are small numbers and can be passed using xmlrpc. If we return the libvirt format, [True, False, ...], call it "cpusStatus" Line 624: Line 625: first_sample, last_sample, _ = self._samples.stats() Line 626: if first_sample is None: Line 627: return stats Line 681: Line 682: def _get_online_cpus(): Line 683: """ Line 684: Ask libirt which cpu cores are currently online. Line 685: The result is a list containing the indices of all online cpu cores. The format libvirt returns [True, False, ...] is more useful and should be used directly instead. The list of booleans show not only which cpus are online, but how many cpus are in the list. This is more useful for other code in vdsm and for the engine. Line 686: Line 687: :return list like ['1', '2', '5', '6', '7', '8'] Line 688: """ Line 689: (_, cpu_register, _) = libvirtconnection.get().getCPUMap() -- To view, visit https://gerrit.ovirt.org/46270 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73c92f563c7c3e8ffbbcf639eba27fbe55389994 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Roman Mohr <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Omer Frenkel <[email protected]> Gerrit-Reviewer: Roman Mohr <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
