
On 09/09/2014 05:54 AM, Jiri Denemark wrote:
Using virDomainGetJobStats, we can monitor running jobs but sometimes it may be useful to get statistics about a job that already finished, for example, to get the final amount of data transferred during migration or to get an idea about total downtime. This is what the following patches are about.
Version 2: - changed according to John's review (see individual patches for details)
Jiri Denemark (8): Refactor job statistics qemu: Avoid incrementing jobs_queued if virTimeMillisNow fails Add support for fetching statistics of completed jobs qemu: Silence coverity on optional migration stats virsh: Add support for completed job stats qemu: Transfer migration statistics to destination qemu: Recompute downtime and total time when migration completes qemu: Transfer recomputed stats back to source
include/libvirt/libvirt.h.in | 11 ++ src/libvirt.c | 11 +- src/qemu/qemu_domain.c | 189 ++++++++++++++++++++++++++- src/qemu/qemu_domain.h | 32 ++++- src/qemu/qemu_driver.c | 130 ++++-------------- src/qemu/qemu_migration.c | 304 ++++++++++++++++++++++++++++++++++++------- src/qemu/qemu_monitor_json.c | 10 +- src/qemu/qemu_process.c | 9 +- tools/virsh-domain.c | 27 +++- tools/virsh.pod | 10 +- 10 files changed, 557 insertions(+), 176 deletions(-)
One nit: Patch 4 - add an ignore_value() around the "total-time" fetch... ACK - series. Ran through 7.5.0 Coverity FWIW: My NMI from 4/6 of v1 probably had more to do with trying to swap between different windows and forgetting where I was... I think what happened is I read ahead and saw that the values were calculated and started deleting a thought and yes, got interrupted (not difficult to do at times). I was comparing those changes qemuDomainJobInfoToParams for completeness...