From b5efc56afb0c883ab8ce580e3cbfb1a567f80ac6 Mon Sep 17 00:00:00 2001 From: Martino Luca Date: Thu, 6 Sep 2018 07:50:09 -0700 Subject: [PATCH] [Perf] Add more fields to the perf profiler json parser Reviewed By: ddino Differential Revision: D9682878 fbshipit-source-id: aebec94e1 --- infer/src/atd/perf_profiler.atd | 2 ++ infer/src/unit/PerfProfilerATDParserTest.ml | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/infer/src/atd/perf_profiler.atd b/infer/src/atd/perf_profiler.atd index 793fd5f7a..af6972f09 100644 --- a/infer/src/atd/perf_profiler.atd +++ b/infer/src/atd/perf_profiler.atd @@ -2,6 +2,8 @@ type perf_profiler_item = { function_name : string; avg_inclusive_cpu_time_ms : float; avg_exclusive_cpu_time_ms : float; + p90_inclusive_cpu_time_ms : float; + p90_exclusive_cpu_time_ms : float; } type perf_profiler = perf_profiler_item list \ No newline at end of file diff --git a/infer/src/unit/PerfProfilerATDParserTest.ml b/infer/src/unit/PerfProfilerATDParserTest.ml index 0dca17d88..fb616408d 100644 --- a/infer/src/unit/PerfProfilerATDParserTest.ml +++ b/infer/src/unit/PerfProfilerATDParserTest.ml @@ -15,10 +15,12 @@ let test_parser = in [ ("test_parser_1", "[]", []) ; ( "test_parser_2" - , {|[{"function_name":"pkg/cls::\u003Cclinit>","avg_inclusive_cpu_time_ms":123.01234567899,"avg_exclusive_cpu_time_ms":9.8765432123456}]|} + , {|[{"function_name":"pkg/cls::\u003Cclinit>","avg_inclusive_cpu_time_ms":123.01234567899,"avg_exclusive_cpu_time_ms":9.8765432123456,"p90_inclusive_cpu_time_ms":1.012,"p90_exclusive_cpu_time_ms":3.14159}]|} , [ { Perf_profiler_t.function_name= "pkg/cls::" ; avg_inclusive_cpu_time_ms= 123.01234567899 - ; avg_exclusive_cpu_time_ms= 9.8765432123456 } ] ) ] + ; avg_exclusive_cpu_time_ms= 9.8765432123456 + ; p90_inclusive_cpu_time_ms= 1.012 + ; p90_exclusive_cpu_time_ms= 3.14159 } ] ) ] |> List.map ~f:(fun (name, test_input, expected_output) -> name >:: create_test test_input expected_output )