From 68ab61976a32ce1c14cfb50740cc54ef3dc3812c Mon Sep 17 00:00:00 2001 From: Varun Arora Date: Wed, 21 Mar 2018 10:41:47 -0700 Subject: [PATCH] Revert "[reporting][perf] Add PerfStats support for ad-hoc timers" Reviewed By: jvillard Differential Revision: D7352574 fbshipit-source-id: f3c2d58 --- infer/src/backend/InferPrint.ml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index 5edee797b..3bf356cea 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -866,6 +866,11 @@ let get_summary_iterator () = iterate +let register_perf_stats_report () = + let filename = F.sprintf "%s.json" Config.perf_stats_prefix in + PerfStats.register_report_at_exit filename PerfStats.Reporting + + (** Although the out_file is an Option type, the None option is strictly meant for the logs format_kind, and all other formats should contain an outfile value. *) let mk_format format_kind fname = @@ -964,17 +969,6 @@ let pp_summary_and_issues formats_by_report_kind issue_formats = finalize_and_close_files formats_by_report_kind stats -let register_perf_stats_report () = - let fname = F.sprintf "%s.json" Config.perf_stats_prefix in - let rtime_span, initial_times = (Mtime_clock.counter (), Unix.times ()) in - PerfStats.register_report (PerfStats.Time (rtime_span, initial_times)) fname PerfStats.Reporting - - -let report_perf_stats () = - let fname = F.sprintf "%s.json" Config.perf_stats_prefix in - PerfStats.get_reporter fname PerfStats.Reporting () - - let main ~report_json = let issue_formats = init_issues_format_list report_json in let formats_by_report_kind = @@ -985,9 +979,8 @@ let main ~report_json = in register_perf_stats_report () ; init_files formats_by_report_kind ; - ( match Config.from_json_report with + match Config.from_json_report with | Some fname -> pp_json_report_by_report_kind formats_by_report_kind fname | None -> - pp_summary_and_issues formats_by_report_kind issue_formats ) ; - report_perf_stats () + pp_summary_and_issues formats_by_report_kind issue_formats