Skip to content
Snippets Groups Projects
Commit c9ca4363 authored by Valentin Perrelle's avatar Valentin Perrelle Committed by David Bühler
Browse files

[Eva] statistics: reset statistics at the start of each analysis

parent ae81c18f
No related branches found
No related tags found
No related merge requests found
...@@ -214,6 +214,7 @@ let force_compute () = ...@@ -214,6 +214,7 @@ let force_compute () =
Eva_audit.check_configuration (Kernel.AuditCheck.get ()); Eva_audit.check_configuration (Kernel.AuditCheck.get ());
let kf, lib_entry = Globals.entry_point () in let kf, lib_entry = Globals.entry_point () in
reset_analyzer (); reset_analyzer ();
Statistics.reset_all ();
(* The new analyzer can be accesed through hooks *) (* The new analyzer can be accesed through hooks *)
Self.set_computation_state Computing; Self.set_computation_state Computing;
let module Analyzer = (val snd !ref_analyzer) in let module Analyzer = (val snd !ref_analyzer) in
......
...@@ -161,6 +161,9 @@ let incr (type a) (stat : a t) (x : a) = ...@@ -161,6 +161,9 @@ let incr (type a) (stat : a t) (x : a) =
let grow (type a) (stat : a t) (x : a) value = let grow (type a) (stat : a t) (x : a) value =
update stat x (fun v -> max v value) update stat x (fun v -> max v value)
let reset_all () =
State.clear ()
(* -- Export --- *) (* -- Export --- *)
......
...@@ -36,5 +36,8 @@ val incr : 'a t -> 'a -> unit ...@@ -36,5 +36,8 @@ val incr : 'a t -> 'a -> unit
(* Set the stat to the maximum between the current value and the given value *) (* Set the stat to the maximum between the current value and the given value *)
val grow : 'a t -> 'a -> int -> unit val grow : 'a t -> 'a -> int -> unit
(* Reset all statistics to zero *)
val reset_all: unit -> unit
(* Export the computed statistics as CSV *) (* Export the computed statistics as CSV *)
val export_as_csv : ?filename:Filepath.Normalized.t -> unit -> unit val export_as_csv : ?filename:Filepath.Normalized.t -> unit -> unit
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment