package trace-tef

  1. Overview
  2. Docs
A simple backend for trace, emitting Catapult/TEF JSON into a file

Install

dune-project
 Dependency

Authors

Maintainers

Sources

trace-0.12.tbz
sha256=c173d6bf9433e9eeb41bbddda116a296373d45865841dcbb78bff3be8abd9fd8
sha512=1105c52112095fdc8d4961d7346b02e416627bde6ac79ddd137bff63ac0ff5cd23fa53192be642614efadb9cb0cbb83b7d571bb5a0d100ad0ae6d10bc61d3bba

doc/trace-tef/Trace_tef/index.html

Module Trace_tefSource

TEF collector for Trace.

This emits chrome traces (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/), which are very simple and a known quantity.

They can be opened in https://ui.perfetto.dev .

Sourcemodule Collector_tef : sig ... end
Sourcemodule Exporter : sig ... end

An exporter, takes JSON objects and writes them somewhere

Sourcemodule Writer : sig ... end

Write JSON events to a buffer.

Sourcemodule Types : sig ... end
Sourcetype output = [
  1. | `Stdout
  2. | `Stderr
  3. | `File of string
]

Output for tracing.

  • `Stdout will enable tracing and print events on stdout
  • `Stderr will enable tracing and print events on stderr
  • `File "foo" will enable tracing and print events into file named "foo"
Sourceval collector : out:[< output ] -> unit -> Trace_core.collector

Make a collector that writes into the given output. See setup for more details.

Sourceval setup : ?debug:bool -> ?out:[ output | `Env ] -> unit -> unit

setup () installs the collector depending on out.

  • parameter out

    can take different values:

    • regular output value to specify where events go
    • `Env will enable tracing if the environment variable "TRACE" is set.
  • If it's set to "1", then the file is "trace.json".
  • If it's set to "stdout", then logging happens on stdout (since 0.2)
  • If it's set to "stderr", then logging happens on stdout (since 0.2)
  • Otherwise, if it's set to a non empty string, the value is taken to be the file path into which to write.
  • parameter debug

    if true, use Trace_debug. Default false.

Sourceval with_setup : ?debug:bool -> ?out:[ output | `Env ] -> unit -> (unit -> 'a) -> 'a

with_setup () f (optionally) sets a collector up, calls f(), and makes sure to shutdown before exiting. since 0.2 a () argument was added.