From b0af574b2dd25abec479cb2455d8b479a29f9deb Mon Sep 17 00:00:00 2001 From: Rijnard van Tonder Date: Mon, 5 Apr 2021 22:27:58 -0700 Subject: [PATCH] dont need statistics --- lib/dune | 3 +-- lib/statistics/dune | 5 ----- lib/statistics/statistics.ml | 31 ------------------------------- lib/statistics/statistics.mli | 11 ----------- lib/statistics/time.ml | 23 ----------------------- 5 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 lib/statistics/dune delete mode 100644 lib/statistics/statistics.ml delete mode 100644 lib/statistics/statistics.mli delete mode 100644 lib/statistics/time.ml diff --git a/lib/dune b/lib/dune index 395e369..ef32582 100644 --- a/lib/dune +++ b/lib/dune @@ -10,5 +10,4 @@ comby_js.matchers comby_js.pipeline comby_js.replacement - comby_js.rewriter - comby_js.statistics)) + comby_js.rewriter)) diff --git a/lib/statistics/dune b/lib/statistics/dune deleted file mode 100644 index c53a0d1..0000000 --- a/lib/statistics/dune +++ /dev/null @@ -1,5 +0,0 @@ -(library - (name statistics) - (public_name comby_js.statistics) - (preprocess (pps ppx_deriving_yojson)) - (libraries yojson )) diff --git a/lib/statistics/statistics.ml b/lib/statistics/statistics.ml deleted file mode 100644 index 1711708..0000000 --- a/lib/statistics/statistics.ml +++ /dev/null @@ -1,31 +0,0 @@ -type t = - { number_of_files : int - ; lines_of_code : int - ; number_of_matches : int - ; total_time : float - } -[@@deriving yojson] - -let empty = - { number_of_files = 0 - ; lines_of_code = 0 - ; number_of_matches = 0 - ; total_time = 0.0 - } - -let merge - { number_of_files - ; lines_of_code - ; number_of_matches - ; total_time - } - { number_of_files = number_of_files' - ; lines_of_code = lines_of_code' - ; number_of_matches = number_of_matches' - ; total_time = total_time' - } = - { number_of_files = number_of_files + number_of_files' - ; lines_of_code = lines_of_code + lines_of_code' - ; number_of_matches = number_of_matches + number_of_matches' - ; total_time = total_time +. total_time' - } diff --git a/lib/statistics/statistics.mli b/lib/statistics/statistics.mli deleted file mode 100644 index b1695c6..0000000 --- a/lib/statistics/statistics.mli +++ /dev/null @@ -1,11 +0,0 @@ -type t = - { number_of_files : int - ; lines_of_code : int - ; number_of_matches : int - ; total_time : float - } -[@@deriving yojson] - -val empty : t - -val merge : t -> t -> t diff --git a/lib/statistics/time.ml b/lib/statistics/time.ml deleted file mode 100644 index 20ffd1b..0000000 --- a/lib/statistics/time.ml +++ /dev/null @@ -1,23 +0,0 @@ -let start () = Unix.gettimeofday () - -let stop start = - (Unix.gettimeofday () -. start) *. 1000.0 - -exception Time_out - -let time_out ~after f args = - let behavior = - Sys.(signal sigalrm @@ Signal_handle (fun _ -> raise Time_out)) - in - let cancel_alarm () = - Unix.alarm 0 |> ignore; - Sys.(set_signal sigalrm behavior) - in - Unix.alarm after |> ignore; - match f args with - | result -> - cancel_alarm (); - result - | exception exc -> - cancel_alarm (); - raise exc