[Pkg-libvirt-commits] [libguestfs] 05/146: v2v: Simplify calculation of Mbps in verbose output.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 17:00:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 5e041d4472091479abae6ae3540c19ca74fad140
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Mon Nov 17 08:58:08 2014 +0000
v2v: Simplify calculation of Mbps in verbose output.
(cherry picked from commit 40cd76eb79cb64ff412847cd43b1b2f1f5427429)
---
v2v/v2v.ml | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index ce998af..8ecf456 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -375,17 +375,18 @@ let rec main () =
(* If verbose, print the virtual and real copying rates. *)
let elapsed_time = end_time -. start_time in
if verbose && elapsed_time > 0. then (
- let rate =
- Int64.to_float t.target_overlay.ov_virtual_size
- /. 1024. /. 1024. *. 10. /. elapsed_time in
- printf "virtual copying rate: %.1f M bits/sec\n%!" rate;
+ let mbps size time =
+ Int64.to_float size /. 1024. /. 1024. *. 10. /. time
+ in
+
+ printf "virtual copying rate: %.1f M bits/sec\n%!"
+ (mbps t.target_overlay.ov_virtual_size elapsed_time);
match t.target_actual_size with
| None -> ()
| Some actual ->
- let rate =
- Int64.to_float actual /. 1024. /. 1024. *. 10. /. elapsed_time in
- printf "real copying rate: %.1f M bits/sec\n%!" rate
+ printf "real copying rate: %.1f M bits/sec\n%!"
+ (mbps actual elapsed_time)
);
(* If verbose, find out how close the estimate was. This is
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list