Introduce command 'virsh domstats --memory' for reporting memory BW

Introduce an option '--memory' for showing memory related
information. The memory bandwidth infomatio is listed as:

Domain: 'libvirt-vm'
 memory.bandwidth.monitor.count=4
 memory.bandwidth.monitor.0.name=vcpus_0-4
 memory.bandwidth.monitor.0.vcpus=0-4
 memory.bandwidth.monitor.0.node.count=2
 memory.bandwidth.monitor.0.node.0.id=0
 memory.bandwidth.monitor.0.node.0.bytes.total=10208067584
 memory.bandwidth.monitor.0.node.0.bytes.local=4807114752
 memory.bandwidth.monitor.0.node.1.id=1
 memory.bandwidth.monitor.0.node.1.bytes.total=8693735424
 memory.bandwidth.monitor.0.node.1.bytes.local=5850161152
 memory.bandwidth.monitor.1.name=vcpus_7
 memory.bandwidth.monitor.1.vcpus=7
 memory.bandwidth.monitor.1.node.count=2
 memory.bandwidth.monitor.1.node.0.id=0
 memory.bandwidth.monitor.1.node.0.bytes.total=853811200
 memory.bandwidth.monitor.1.node.0.bytes.local=290701312
 memory.bandwidth.monitor.1.node.1.id=1
 memory.bandwidth.monitor.1.node.1.bytes.total=406044672
 memory.bandwidth.monitor.1.node.1.bytes.local=229425152

Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
This commit is contained in:
Wang Huaqiang
2020-01-06 14:04:10 +00:00
committed by Daniel P. Berrangé
parent 5d876f25bd
commit 65a63d8864
5 changed files with 152 additions and 2 deletions
+20 -2
View File
@@ -2186,7 +2186,7 @@ domstats
domstats [--raw] [--enforce] [--backing] [--nowait] [--state]
[--cpu-total] [--balloon] [--vcpu] [--interface]
[--block] [--perf] [--iothread]
[--block] [--perf] [--iothread] [--memory]
[[--list-active] [--list-inactive]
[--list-persistent] [--list-transient] [--list-running]y
[--list-paused] [--list-shutoff] [--list-other]] | [domain ...]
@@ -2205,7 +2205,7 @@ behavior use the *--raw* flag.
The individual statistics groups are selectable via specific flags. By
default all supported statistics groups are returned. Supported
statistics groups flags are: *--state*, *--cpu-total*, *--balloon*,
*--vcpu*, *--interface*, *--block*, *--perf*, *--iothread*.
*--vcpu*, *--interface*, *--block*, *--perf*, *--iothread*, *--memory*.
Note that - depending on the hypervisor type and version or the domain state
- not all of the following statistics may be returned.
@@ -2372,6 +2372,24 @@ not available for statistical purposes.
* ``iothread.<id>.poll-shrink`` - polling time shrink value. A value of
(zero) indicates shrink is managed by hypervisor.
*--memory* returns:
* ``memory.bandwidth.monitor.count`` - the number of memory bandwidth
monitors for this domain
* ``memory.bandwidth.monitor.<num>.name`` - the name of monitor <num>
* ``memory.bandwidth.monitor.<num>.vcpus`` - the vcpu list of monitor <num>
* ``memory.bandwidth.monitor.<num>.node.count`` - the number of memory
controller in monitor <num>
* ``memory.bandwidth.monitor.<num>.node.<index>.id`` - host allocated memory
controller id for controller <index> of monitor <num>
* ``memory.bandwidth.monitor.<num>.node.<index>.bytes.local`` - the accumulative
bytes consumed by @vcpus that passing through the memory controller in the
same processor that the scheduled host CPU belongs to.
* ``memory.bandwidth.monitor.<num>.node.<index>.bytes.total`` - the total
bytes consumed by @vcpus that passing through all memory controllers, either
local or remote controller.
Selecting a specific statistics groups doesn't guarantee that the
daemon supports the selected group of stats. Flag *--enforce*
forces the command to fail if the daemon doesn't support the