Martin Polednik has uploaded a new change for review. Change subject: numa: add docstrings for public methods ......................................................................
numa: add docstrings for public methods Change-Id: Id84872556a3f0699a738071ca7d3f9809bea305b Signed-off-by: Martin Polednik <mpoled...@redhat.com> --- M lib/vdsm/numa.py 1 file changed, 32 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/54171/1 diff --git a/lib/vdsm/numa.py b/lib/vdsm/numa.py index 9eac3f3..6ad3e69 100644 --- a/lib/vdsm/numa.py +++ b/lib/vdsm/numa.py @@ -41,13 +41,13 @@ def memory_by_cell(index): - """ + ''' Get the memory stats of a specified numa node, the unit is MiB. :param cell: the index of numa node :type cell: int :return: dict like {'total': '49141', 'free': '46783'} - """ + ''' meminfo = libvirtconnection.get().getMemoryStats(index, 0) meminfo['total'] = str(meminfo['total'] / 1024) meminfo['free'] = str(meminfo['free'] / 1024) @@ -55,14 +55,44 @@ def topology(capabilities=None): + ''' + Get what we call 'numa topology' of the host from libvirt. This topology + contains mapping numa cell -> (cpu ids, total memory). + + Example: + {'0': {'cpus': [0, 1, 2, 3, 4, 10, 11, 12, 13, 14], + 'totalMemory': '32657'}, + '1': {'cpus': [5, 6, 7, 8, 9, 15, 16, 17, 18, 19], + 'totalMemory': '32768'}} + ''' return _numa(capabilities).topology def distances(): + ''' + Get distances between numa nodes. The information is a mapping + numa cell -> [distance], where distances are sorted relatively to cell id + in ascending order. + + Example: + {'0': [10, 21], + '1': [21, 10]} + ''' return _numa().distances def cpu_topology(capabilities=None): + ''' + Get 'cpu topology' of the host from libvirt. This topology tries to + summarize the cpu attributes over all numa cells. It is not reliable and + should be reworked in future. + + Example: + {'sockets': 1, + 'cores': 10, + 'threads': 20, + 'onlineCpus': '0,1,2,3,4,10,11,12,13,14,5,6,7,8,9,15,16,17,18,19'} + ''' return _numa(capabilities).cpu_topology -- To view, visit https://gerrit.ovirt.org/54171 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id84872556a3f0699a738071ca7d3f9809bea305b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik <mpoled...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches