Class: Metrux::Commands::PeriodicGauge::Reporter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/metrux/commands/periodic_gauge/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(command, registry, config) ⇒ Reporter

Returns a new instance of Reporter.



7
8
9
10
11
# File 'lib/metrux/commands/periodic_gauge/reporter.rb', line 7

def initialize(command, registry, config)
  @agent = Agent.new(command, registry, config)
  @supervisor = Supervisor.new(agent, config)
  @config = config
end

Instance Method Details

#startObject



13
14
15
16
17
18
19
20
# File 'lib/metrux/commands/periodic_gauge/reporter.rb', line 13

def start
  return false unless config.active?

  agent.start
  supervisor.start

  true
end

#stopObject



22
23
24
25
# File 'lib/metrux/commands/periodic_gauge/reporter.rb', line 22

def stop
  supervisor.stop
  agent.stop
end