package tracy-client
Client bindings to the Tracy profiler (v0.12)
Install
Dune Dependency
Authors
Maintainers
Sources
tracy-client-0.6.tbz
sha256=826b2dbacad0c91facff9b94309a3c34c25c2b77c0345f330c6b781ac9412c32
sha512=610097fe2a38c7675084910bb195d42d8041aa1addb534ee10dee8983d8b0f2e39dfd1571b4f8857ab0178ad20f024a4fd72cd1a893c28df962ae0506368d156
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 55
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 = () let extension_event _ = () 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)"
>