class

Progress

Inherits Reference < Object

Live heartbeat for long network-bound runs.

bin/track fetches everything before it renders anything, so a healthy run and a hung one look identical: no output at all. A Progress writes one dot per completed request to STDERR, which keeps STDOUT (and therefore every table the CLI prints) clean and redirectable.

note (and the note: lines the CLI already emits) must go through Progress#note while progress is enabled: writing a notice directly to STDERR would land in the middle of a dot run.

Constants

DefaultEvery = 1

One dot per every ticks; a scan that fires thousands of eth_getLogs calls must not emit thousands of dots.

Constructors

new(io : IO = STDERR, label : String = "requests", enabled : Bool = true, every : Int32 = DefaultEvery)
Source

Instance methods

count
Source
disable

--progress=false stops the heartbeat but leaves notes working.

Source
enabled?
Source
finish

Closes the dot run and reports how many requests the run made. Called once from the CLI's ensure, so it still fires when the run raises.

Source
note(message : String) : Nil

A human-readable notice. Terminates an open dot run first so the notice starts on its own line.

Source
start(message : String) : Nil

Opens the status line with what the run is about to do. Called before the first request so the program is never silent, even for the first second.

Source
tick

Records one completed request. No-op once disabled, so callers can tick unconditionally.

A dot is the whole output. An earlier version appended a running counter on a terminal, which turned into an unreadable requests 1 … requests 99 line: it never overwrote itself and it buried the dots it was meant to accompany. The exact total is reported once, by finish.

Source
warn(message : String) : Nil

Warning/hint line, aligned with note.

Source