const classjig::StatusBar

sys::Obj
  jig::StatusBar

StatusBar renders the single line progress display.

bar

Source

static Str bar(Int done, Int total)

Bar of barSize cells with eighth-cell partial blocks.

barSize

Source

const static Int barSize := 20

Width of the progress bar in cells.

fmtBarDur

Source

static Str fmtBarDur(Duration d)

Format status bar clock as 12.3sec, then 3min 10.4sec; tenths are truncated so the clock never jumps ahead.

fmtDur

Source

static Str fmtDur(Duration d)

Format duration as 12.3sec, or 2min 5sec once past 59sec.

fmtDurMs

Source

static Str fmtDurMs(Duration d)

Format duration as 4900ms under 5sec, 7.2sec under 1min, then 2min 5sec; rounded to nearest tenth or whole second.

render

Source

static Str render(Int total, Int passed, Int failed, Str? label, Duration elapsed, Int width, Bool color := true)

Render status line to fit within width columns:

[█▏░░░░] 6% 80/1324 | ✓ 80 4.8sec | core [79/149]

If the line is too wide the label is clipped from the left or dropped first, then the time.