-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, I use the following code snippet based on xapi.py to request the metrics of the DomU''s.> def request_vif_metrics(): > server, session = connect() > vm_uuids = execute(server, ''VM.get_all'', (session,)) > > for uuid in vm_uuids: > vm_info = execute(server, ''VM.get_record'', (session, uuid)) > vifs = vm_info[''VIFs''] > read = 0.0; > write = 0.0; > for vif in vifs: > vif_metrics = execute(server, ''VIF.get_metrics'', (session, vif)) > vif_metrics_struct = execute(server, ''VIF_metrics.get_record'', (session, vif_metrics)) > print vif_metrics_struct > read += vif_metrics_struct[''io_read_kbs''] > write += vif_metrics_struct[''io_write_kbs''] > print ''%s: %f %f'' % (vm_info[''name_label''], read, write)I would expect to get some numbers higher than 0.0 from the vif_metrics_struct. The actual output: Domain-0: 0.000000 0.000000 {''io_read_kbs'': 0.0, ''last_updated'': <DateTime ''20071117T03:01:10'' at 808e60>, ''io_write_kbs'': 0.0} skinkie_gentoo_old: 0.000000 0.000000 {''io_read_kbs'': 0.0, ''last_updated'': <DateTime ''20071117T03:01:10'' at 808908>, ''io_write_kbs'': 0.0} gameserver01: 0.000000 0.000000 I''m running Xen-tools 3.1.1, am I running an older version, or is this a bug? Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPkxUYH1+F2Rqwn0RCjPSAJ479OCLZG+BUUI1c9jYl34roerpmwCeIuhc uGeBRULLsd3pWuOtynnapZI=vBew -----END PGP SIGNATURE----- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan de Konink
2007-Nov-17 05:38 UTC
Re: [Xen-devel] VIF_metrics = 0 [workaround] -> Feature request
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Stefan de Konink schreef:> I would expect to get some numbers higher than 0.0 from the > vif_metrics_struct.Problem occurs when a vifname is given for the virtual interface. As in Bug 1111. Now I get the read_io and write_io, I honestly was looking for the total amount of bytes received/sent. Would it be accepted if this was implemented in the VIF_metrics? Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPn49YH1+F2Rqwn0RCoN+AJ9bQ0RmLDPjsCzeNsX9chE/lwIHhwCfTOoQ Z+uiv/qy3ql4T7+WuFQ8h/Q=CucA -----END PGP SIGNATURE----- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan de Konink
2007-Nov-17 05:46 UTC
Re: [Xen-devel] VIF_metrics = 0 [workaround] -> Feature request [in unstable]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Stefan de Konink schreef:> Now I get the read_io and write_io, I honestly was looking for the total > amount of bytes received/sent. Would it be accepted if this was > implemented in the VIF_metrics?It is interesting to respond to myself, but in Xen Unstable I have found the vif_stats implementation, so I''ll give it a try. Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPoAnYH1+F2Rqwn0RCj5iAKCKbnFo1/tKRiqLYehmRcHZ8K8X5ACfV4Gn fhsVam+DWC4fRHv9/zRCSD0=aM9B -----END PGP SIGNATURE----- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Stefan de Konink schreef:> Stefan de Konink schreef: >> Now I get the read_io and write_io, I honestly was looking for the total >> amount of bytes received/sent. Would it be accepted if this was >> implemented in the VIF_metrics? > > It is interesting to respond to myself, but in Xen Unstable I have found > the vif_stats implementation, so I''ll give it a try.Here is an extension to the XenAPI. It is probably useful in other situations too, such as on the Physical Interface. This extension implements total statistics on the virtual interface of a domain. Useful when you want to fill RRD files per domain, from the XenAPI. It is a patch against 3.1.2. Unstable looks the same. So I guess it should work there too. Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHPpgaYH1+F2Rqwn0RCs4MAJwMm8jxG0QXMtPTpp75iu8rpT+z/wCeLPq2 uOyuQRXgBO6rxbxiLPZmlGs=3di/ -----END PGP SIGNATURE----- _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel