struct

Phosphor::Stats

Inherits Struct < Value < Object

Snapshot of Renderer#draw's cost on its most recent call — always collected regardless of whether anything displays it (see Renderer#stats's doc comment for why collection is unconditional).

Constructors

new(cells_changed : Int32, bytes_written : Int32, avg_draw_time_ms : Float64)
Source

Instance methods

avg_draw_time_ms

Rolling average draw duration, in milliseconds, over the last Renderer::FPS_SAMPLE_SIZE #draw calls.

Source
bytes_written

Number of bytes written to the terminal by the last #draw call — the size of the ANSI string handed to Terminal#write. Zero when cells_changed is zero, since nothing was written that frame.

Source
cells_changed

Number of cells the last #draw call actually wrote to the terminal — the diff (or full redraw) minus any Cell::CONTINUATION slots, which are skipped in the write loop since the wide character's primary cluster already covers them. Zero when the frame had no visible change.

Source