# `mix cauldron.input`
[🔗](https://github.com/jaman/cauldron/blob/v0.1.3/cauldron_2d_drafter/lib/mix/tasks/cauldron.input.ex#L1)

Measure drafter's input path from a `DRAFTER_TRACE` log.

    DRAFTER_TRACE=1 mix my_game
    mix cauldron.input                 # reads ./drafter_trace.log
    mix cauldron.input /tmp/other.log

Takes the log path as its one optional argument, defaulting to `drafter_trace.log` in the
current directory, and raises if it cannot be read. Lines it does not recognise are ignored.

## The log

drafter writes one line per event, `<kind> <hh:mm:ss.uuuuuu> <rest>`:

  * `S` — a chunk read from stdin, ending in the bytes as hex
  * `I` — a decoded event, such as a mouse report
  * `W` — a frame written to the terminal, with `bytes=`, `lines=` and `write_us=` fields

## What it prints

Counts of chunks, decoded events and mouse events, then median, p90 and max for the bytes
per read, the delay from a chunk arriving to the event it becomes, the gap between reads, and
the gap between mouse events. For the writes it prints bytes and lines per frame and the time
spent inside the write call, plus a count of writes over 5 ms, which is time the terminal
spent not draining what it was sent.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
