class Bosh::Deployer::DeployerRenderer
Public Class Methods
new(event_log_renderer)
click to toggle source
# File lib/bosh/deployer/deployer_renderer.rb, line 3 def initialize(event_log_renderer) @event_log_renderer = event_log_renderer @index = 0 end
Public Instance Methods
duration()
click to toggle source
# File lib/bosh/deployer/deployer_renderer.rb, line 36 def duration @event_log_renderer.duration end
enter_stage(stage, total)
click to toggle source
# File lib/bosh/deployer/deployer_renderer.rb, line 12 def enter_stage(stage, total) @stage = stage @total = total @index = 0 end
finish(state)
click to toggle source
# File lib/bosh/deployer/deployer_renderer.rb, line 8 def finish(state) @event_log_renderer.finish(state) end
update(state, task)
click to toggle source
# File lib/bosh/deployer/deployer_renderer.rb, line 18 def update(state, task) event = { 'time' => Time.now.to_i, 'stage' => @stage, 'task' => task, 'tags' => [], 'index' => @index + 1, 'total' => @total, 'state' => state.to_s, 'progress' => state == :finished ? 100 : 0, } @event_log_renderer.add_output(JSON.generate(event)) @event_log_renderer.refresh @index += 1 if state == :finished end