Module: ExcADG::Tui

Defined in:
lib/excadg/tui.rb

Overview

render status on the screen

Constant Summary collapse

MAX_VERTEX_TO_SHOW =
10
DELAY =
0.2
DEFAULT_BOX_SIZE =
{ height: 50, width: 150 }.freeze

Class Method Summary collapse

Class Method Details

.runObject

spawns a thread to show stats to console in background



20
21
22
23
24
25
26
27
28
# File 'lib/excadg/tui.rb', line 20

def run
  Log.info 'spawning tui'
  @thread = Thread.new {
    loop {
      print_in_box stats
      sleep DELAY
    }
  }
end

.summarize(has_failed, timed_out) ⇒ Object



30
31
32
33
# File 'lib/excadg/tui.rb', line 30

def summarize has_failed, timed_out
  @thread.kill
  print_in_box stats + (print_summary has_failed, timed_out)
end