Reviewed By: ezgicicek Differential Revision: D8447384 fbshipit-source-id: 7b890e8master
parent
a274cdf785
commit
8b7148d5b0
@ -0,0 +1,7 @@
|
||||
type perf_profiler_item = {
|
||||
function_name : string;
|
||||
avg_inclusive_cpu_time_ms : float;
|
||||
avg_exclusive_cpu_time_ms : float;
|
||||
}
|
||||
|
||||
type perf_profiler = perf_profiler_item list
|
@ -0,0 +1,26 @@
|
||||
(*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
open OUnit2
|
||||
|
||||
let test_parser =
|
||||
let create_test input expected _ =
|
||||
let found = Perf_profiler_j.perf_profiler_of_string input in
|
||||
assert_equal expected found
|
||||
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}]|}
|
||||
, [ { Perf_profiler_t.function_name= "pkg/cls::<clinit>"
|
||||
; avg_inclusive_cpu_time_ms= 123.01234567899
|
||||
; avg_exclusive_cpu_time_ms= 9.8765432123456 } ] ) ]
|
||||
|> List.map ~f:(fun (name, test_input, expected_output) ->
|
||||
name >:: create_test test_input expected_output )
|
||||
|
||||
|
||||
let tests = "java_profiler_samples" >::: test_parser
|
Loading…
Reference in new issue