aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2018-06-26 15:26:35 +0200
committerJuan Quintela <quintela@redhat.com>2018-06-27 13:28:11 +0200
commit6cde6fbe2b2ad672029ce9737659aa34f581c07a (patch)
treeb2bde7c921f727985b1af54f705cbba04134f965
parent2a26c979b15dfedc1d7f4df7ed7e853d768e2850 (diff)
migration: Calculate mbps only during transfer time
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 <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r--migration/migration.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/migration/migration.c b/migration/migration.c
index e1eaa97df4..d3e6da9bfe 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -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;
}
}