]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-44731: record timings for all xapi startup tasks for diagnostic purposes. Data...
authorDavid Scott <dave.scott@eu.citrix.com>
Tue, 12 Oct 2010 09:32:46 +0000 (10:32 +0100)
committerDavid Scott <dave.scott@eu.citrix.com>
Tue, 12 Oct 2010 09:32:46 +0000 (10:32 +0100)
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
ocaml/xapi/startup.ml

index fbc7894a49ef58a0fd25ba16988468ac1bba418f..569186aeeb5b5380ae8ac8f15da63b67f10c73c8 100644 (file)
@@ -53,6 +53,9 @@ let run ~__context tasks =
 
   (* iterate tasks *)
   List.iter (fun (tsk_name, tsk_flags, tsk_fct) ->
+       (* Wrap the function with a timer *)
+       let tsk_fct () = Stats.time_this tsk_name tsk_fct in
+
     let only_master, only_slave, exnraise, onthread = get_flags_of_list tsk_flags in
     try
       if (only_master && is_master)
@@ -73,3 +76,5 @@ let run ~__context tasks =
       if exnraise then
         raise exn
   ) tasks
+
+let run ~__context tasks = Stats.time_this "overall xapi startup" (fun () -> run ~__context tasks)
\ No newline at end of file