* [Qemu-devel] [PATCH] migration: show average throughput when migration finishes
@ 2014-05-12 8:46 Peter Lieven
2014-05-12 14:29 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Peter Lieven @ 2014-05-12 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, Peter Lieven, dgilbert, quintela
currently the value of the throughput field contains whatever
was the last calculated throughput shortly before the migration
finished.
This patch updates the post migration contents of the field to
the average throughput.
Signed-off-by: Peter Lieven <pl@kamp.de>
diff --git a/migration.c b/migration.c
index 52cda27..3fc03d6 100644
--- a/migration.c
+++ b/migration.c
@@ -662,8 +662,13 @@ static void *migration_thread(void *opaque)
qemu_mutex_lock_iothread();
if (s->state == MIG_STATE_COMPLETED) {
int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+ uint64_t transferred_bytes = qemu_ftell(s->file);
s->total_time = end_time - s->total_time;
s->downtime = end_time - start_time;
+ if (s->total_time) {
+ s->mbps = (((double) transferred_bytes * 8.0) /
+ ((double) s->total_time)) / 1000;
+ }
runstate_set(RUN_STATE_POSTMIGRATE);
} else {
if (old_vm_running) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] migration: show average throughput when migration finishes
2014-05-12 8:46 [Qemu-devel] [PATCH] migration: show average throughput when migration finishes Peter Lieven
@ 2014-05-12 14:29 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-05-12 14:29 UTC (permalink / raw)
To: Peter Lieven, qemu-devel; +Cc: dgilbert, quintela
Il 12/05/2014 10:46, Peter Lieven ha scritto:
> currently the value of the throughput field contains whatever
> was the last calculated throughput shortly before the migration
> finished.
>
> This patch updates the post migration contents of the field to
> the average throughput.
>
> Signed-off-by: Peter Lieven <pl@kamp.de>
>
> diff --git a/migration.c b/migration.c
> index 52cda27..3fc03d6 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -662,8 +662,13 @@ static void *migration_thread(void *opaque)
> qemu_mutex_lock_iothread();
> if (s->state == MIG_STATE_COMPLETED) {
> int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> + uint64_t transferred_bytes = qemu_ftell(s->file);
> s->total_time = end_time - s->total_time;
> s->downtime = end_time - start_time;
> + if (s->total_time) {
> + s->mbps = (((double) transferred_bytes * 8.0) /
> + ((double) s->total_time)) / 1000;
> + }
> runstate_set(RUN_STATE_POSTMIGRATE);
> } else {
> if (old_vm_running) {
>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-12 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-12 8:46 [Qemu-devel] [PATCH] migration: show average throughput when migration finishes Peter Lieven
2014-05-12 14:29 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).