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.logTakes 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 hexI— a decoded event, such as a mouse reportW— a frame written to the terminal, withbytes=,lines=andwrite_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.