From 74dc634d93980cbc5f992ab0f70e48d0bbdab5bd Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg@phi-gamma.net>
Date: Thu, 11 Oct 2018 00:41:11 +0200
Subject: log download completion time

---
 context_mirror_bot.ml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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));
 ;;
 
-- 
cgit v1.2.3