summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-10-11 00:41:11 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-10-11 00:41:11 +0200
commit74dc634d93980cbc5f992ab0f70e48d0bbdab5bd (patch)
treed516753c66aea456d2664226478d99b1561a86ff
parent5da3c8132776bce8451f21a0f1ee303761996215 (diff)
downloadcontext-mirror-bot-74dc634d93980cbc5f992ab0f70e48d0bbdab5bd.tar.gz
log download completion time
-rw-r--r--context_mirror_bot.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/context_mirror_bot.ml b/context_mirror_bot.ml
index 749c0d3..6a0fd05 100644
--- a/context_mirror_bot.ml
+++ b/context_mirror_bot.ml
@@ -176,6 +176,8 @@ ssh -i \"${keyfile}\" $@
* auxiliary functions
*****************************************************************************)
+let now () = Unix.gettimeofday ()
+
let format_time t =
let open Unix in
let ut = localtime t in
@@ -641,7 +643,11 @@ let download_zipball src =
Unix.unlink dst
end;
msg "Downloading source archive [%s]" src.url;
+ let t0 = now () in
grab_file src.url dst;
+ log_info (Printf.sprintf
+ "Download of [%s] completed in %.2f s."
+ src.url (abs_float (now () -. t0)));
dst
let epoch = 0.
@@ -837,6 +843,6 @@ let () =
dispatch_job job;
log_info (Printf.sprintf
"mirror bot finished in %.2f s."
- (Unix.gettimeofday () -. t_start));
+ (now () -. t_start));
;;