package miou
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=85c46f74a17cad5120ae6b7e1b1509d26f119c626c4dec2a05009f8c57b81558
sha512=429d0787439940614b74ebed18582fb1afe31a8f74cc9092b756ec841d33f34bd0e1951bb8d5aa88618d23380debf7a28b4530b9f6afafff1cef7949b3b7bbcf
doc/miou.runtime_events/Miou_runtime_events/index.html
Module Miou_runtime_eventsSource
The Miou Trace system with Runtime_events.
This module allows you to connect the trace data output by Miou to the Runtime_events module provided by OCaml using the reporter function. To ensure that the user has a trace of Miou events, they must call Miou.Trace.set_reporter Miou_runtime_events.reporter. It should be noted that the trace is only emitted if the environment variable MIOU_TRACE=1 exists.
This module also allows a consumer to be associated with Miou events using add_callbacks. In this way, the user, using the Runtime_events module, can obtain Miou events from a program via a cursor.
reporter is a function to connect the Trace producer to the Runtime_events producer. If the user would like to emit trace from a Miou application, the program must be executed with MIOU_TRACE=1 and:
let () = Miou.Trace.set_reporter Miou_runtime_events.reporterval add_callbacks :
fn:(int -> Runtime_events.Timestamp.t -> Miou.Trace.event -> unit) ->
Runtime_events.Callbacks.t ->
Runtime_events.Callbacks.tadd_callbacks ~fn cbs adds a consumer fn for Miou events.
let cursor = Runtime_events.create_cursor (Some (cwd, pid)) in
let cbs = Runtime_events.Callbacks.create () in
let cbs = Miou_runtime_events.add_callbacks ~fn cbs in
...
let _ = Runtime_events.read_poll cursor cbs None in
...
Runtime_events.free_cursor cursor