Class: Metrux::Commands::PeriodicGauge::Reporter
- Inherits:
-
Object
- Object
- Metrux::Commands::PeriodicGauge::Reporter
- Extended by:
- Forwardable
- Defined in:
- lib/metrux/commands/periodic_gauge/reporter.rb
Instance Method Summary collapse
-
#initialize(command, registry, config) ⇒ Reporter
constructor
A new instance of Reporter.
- #start ⇒ Object
- #stop ⇒ Object
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
#start ⇒ Object
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 |
#stop ⇒ Object
22 23 24 25 |
# File 'lib/metrux/commands/periodic_gauge/reporter.rb', line 22 def stop supervisor.stop agent.stop end |