From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXsZ9-000381-So for qemu-devel@nongnu.org; Tue, 26 Jun 2018 14:19:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXsZ6-0001iO-OO for qemu-devel@nongnu.org; Tue, 26 Jun 2018 14:19:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35134 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXsZ6-0001iH-KI for qemu-devel@nongnu.org; Tue, 26 Jun 2018 14:19:44 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 47BA49D92 for ; Tue, 26 Jun 2018 18:19:44 +0000 (UTC) From: Juan Quintela Date: Tue, 26 Jun 2018 20:19:21 +0200 Message-Id: <20180626181932.11909-3-quintela@redhat.com> In-Reply-To: <20180626181932.11909-1-quintela@redhat.com> References: <20180626181932.11909-1-quintela@redhat.com> Subject: [Qemu-devel] [PATCH v16 03/14] migration: Calculate mbps only during transfer time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com 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 --- migration/migration.c | 6 ++++-- 1 file 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; } } -- 2.17.1