]> Git Repo - qemu.git/commitdiff
migration: Calculate mbps only during transfer time
authorJuan Quintela <[email protected]>
Tue, 26 Jun 2018 13:26:35 +0000 (15:26 +0200)
committerJuan Quintela <[email protected]>
Wed, 27 Jun 2018 11:28:11 +0000 (13:28 +0200)
We used to include in this calculation the setup time, but that can be
quite big in rdma or multifd.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
migration/migration.c

index e1eaa97df4eb31a365880b3814f04ca49da373a0..d3e6da9bfede96c621961d85ff61081a960c01c9 100644 (file)
@@ -2708,6 +2708,7 @@ static void migration_calculate_complete(MigrationState *s)
 {
     uint64_t bytes = qemu_ftell(s->to_dst_file);
     int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+    int64_t transfer_time;
 
     s->total_time = end_time - s->start_time;
     if (!s->downtime) {
@@ -2718,8 +2719,9 @@ static void migration_calculate_complete(MigrationState *s)
         s->downtime = end_time - s->downtime_start;
     }
 
-    if (s->total_time) {
-        s->mbps = ((double) bytes * 8.0) / s->total_time / 1000;
+    transfer_time = s->total_time - s->setup_time;
+    if (transfer_time) {
+        s->mbps = ((double) bytes * 8.0) / transfer_time / 1000;
     }
 }
 
This page took 0.030037 seconds and 4 git commands to generate.