package miou
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=56ea30ffd0924d941c8afdb96749252cc4af61465d392178c70475a7859284d5
sha512=42edbb87b4f9c3a0e67e85aebf037e8b6835eae7c8731a7e5caeb6d17be488137bc3bd5c4a375cd03f8eeac2f9d71e24ff0706b9877cc1dc6132666db1fa31d2
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