pcp
[Top] [All Lists]

libvirt pmda: adjust block dev metrics collection

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: libvirt pmda: adjust block dev metrics collection
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 18 Jul 2016 14:27:27 +0300
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2
Hi,

libvirt.git/src/libvirt-domain.c says:

 * VIR_DOMAIN_STATS_BLOCK: Return block devices statistics.  By default,
 * this information is limited to the active layer of each <disk> of the
 * domain (where block.count is equal to the number of disks), but adding
 * VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING to @flags will expand the
 * array to cover backing chains (block.count corresponds to the number
 * of host resources used together to provide the guest disks).

I think we could perhaps at least start without that flag, and if needed
then provide an configuration option to enable it. The patch below changes
the flag:

---
 src/pmdas/libvirt/pmdalibvirt.python | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pmdas/libvirt/pmdalibvirt.python 
b/src/pmdas/libvirt/pmdalibvirt.python
index fa30b53..7445587 100755
--- a/src/pmdas/libvirt/pmdalibvirt.python
+++ b/src/pmdas/libvirt/pmdalibvirt.python
@@ -462,7 +462,7 @@ class LibvirtPMDA(PMDA):
             try:
                 self.vm_blockstats_res = []
                 if not self.oldapi:
-                    stats = libvirt.VIR_DOMAIN_STATS_BLOCK | 
libvirt.VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING
+                    stats = libvirt.VIR_DOMAIN_STATS_BLOCK
                     self.vm_blockstats_res = 
self.conn.domainListGetStats(self.doms, stats, flags)
                 else:
                     for dom in self.doms:


For reference, in case the backing flag is considered later, this comment
from the earlier mentioned file is good to keep in mind:

 * "block.<num>.backingIndex" - unsigned int giving the <backingStore> index,
 *                              only used when backing images are listed.

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>
  • libvirt pmda: adjust block dev metrics collection, Marko Myllynen <=