package tracing

  1. Overview
  2. Docs
val iobuf_destination : (Core.read_write, Iobuf.seek) Iobuf.t -> (module Writer_intf.Destination)

Write to a provided Iobuf.t, throws an exception if the buffer runs out of space. After the Destination is closed, sets the window of the Iobuf.t to the data written.

val raw_iobuf_destination : (Core.read_write, Iobuf.seek) Iobuf.t -> (module Writer_intf.Destination)

Write to a provided Iobuf.t, throws an exception if the buffer runs out of space. Dynamically updates the window of the Iobuf.t as data is written, and does not set the window to the data writen on closure.

val black_hole_destination : len:int -> touch_memory:bool -> (module Writer_intf.Destination)

Creates a new buffer, which is reset and reused on every call to next_buf, effectively dropping all the previously-recorded content, as the name suggests. Useful for performance benchmarking or having trace events be ignored without growing an in-memory log.

len is the length of the buffer and can be tuned to simulate different cache characteristics in a benchmark or avoid using much memory when ignoring events.

If touch_memory is true, the memory will be written over to ensure all the memory is paged in, to reduce benchmark variance.

module Buffer_until_initialized : sig ... end

Starts by keeping events in internal memory buffers. After set_destination is called it will copy any buffered events into the new destination upon the next buffer switch, then provide a buffer directly from the newly set destination.

OCaml

Innovation. Community. Security.