package tracy-client
Client bindings to the Tracy profiler (v0.10)
Install
Dune Dependency
Authors
Maintainers
Sources
tracy-client-0.5.tbz
sha256=11053d178438a76b94680275a46cedb79225da8bf72eb886787b404123ce6516
sha512=87b7d1fbd75b90a4881aa91fc86f85f1d7fa3a1ae54293f64a191294c7347840cd7954e0792887dbca40efa9cfed0f183926e2b1fa885b4f7b7d788c65c099e8
doc/src/tracy-client.trace/tracy_client_trace.ml.html
Source file tracy_client_trace.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
type explicit_span = Trace.explicit_span let spf = Printf.sprintf module C () : Trace.Collector.S = struct let name_thread = Tracy_client.name_thread let name_process _ = () let process_data sp (d : string * Trace.user_data) = let k, v = d in let msg = match v with | `String s -> spf "%s: %s\n" k s | `Int i -> spf "%s: %d\n" k i | `Bool b -> spf "%s: %b\n" k b | `None -> spf "%s\n" k | `Float f -> spf "%f\n" f in Tracy_client.add_text sp msg let enter_span ~__FUNCTION__ ~__FILE__ ~__LINE__ ~data name : Trace.span = let sp = Tracy_client.enter ?__FUNCTION__ ~__FILE__ ~__LINE__ name in if data <> [] then List.iter (process_data sp) data; Int64.of_int sp let exit_span (sp : Trace.span) : unit = Tracy_client.exit (Int64.to_int sp) let with_span ~__FUNCTION__ ~__FILE__ ~__LINE__ ~data name f = let sp = enter_span ~__FUNCTION__ ~__FILE__ ~__LINE__ ~data name in let finally () = exit_span sp in Fun.protect ~finally (fun () -> f sp) let message ?span:_ ~data:_ msg : unit = Tracy_client.message msg let counter_float ~data:_ name n : unit = Tracy_client.plot name n let counter_int ~data name n : unit = counter_float ~data name (float_of_int n) let shutdown () = () let add_data_to_span _ _ = () let add_data_to_manual_span _ _ = () let enter_manual_span ~parent:_ ~flavor:_ ~__FUNCTION__:_ ~__FILE__:_ ~__LINE__:_ ~data:_ _name : explicit_span = Trace.Collector.dummy_explicit_span let exit_manual_span _es : unit = () end let collector () : Trace.collector = let module C = C () in (module C) let setup () = Trace.setup_collector @@ collector ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>