Documentation
¶
Overview ¶
Package inputtrace records what the client and the host do with the pointer and the input around it, one JSON object a line, for debugging a cursor that goes astray. Off, it costs an atomic load: callers guard with On, or call Emit, which checks it before boxing its fields.
Each record has ts (UTC, RFC 3339 with nanoseconds), t_ns (the process's transport.Mono clock, which the latency traces use too), side and kind, then the fields of its kind. Records go through a bounded queue to a goroutine that writes them; a full queue drops them, and the writer notes how many with a trace_dropped record.
Index ¶
Constants ¶
const ( // MaxFileBytes is how large a trace file grows before the next one // starts. MaxFileBytes = 20 << 20 // KeepFiles is how many trace files of a side stay, the newest. KeepFiles = 5 // Env turns tracing on for a run, as the -input-trace flag does. Env = "PLANCK_INPUT_TRACE" )
Variables ¶
var ( Client = New(SideClient) Host = New(SideHost) )
Client and Host are the process's tracers. A client app that hosts too writes both, each to its own files.
Functions ¶
Types ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer writes one side's trace while enabled. Its methods are safe from any goroutine.
func (*Tracer) Disable ¶
Disable stops recording and returns once every record queued is on disk and the file is closed.
func (*Tracer) Enable ¶
Enable starts a trace file in dir, keeping the newest KeepFiles of the side, and returns its path. Enabled already, it keeps the file it has.