Class: NewRelic::Starter
- Inherits:
-
Object
- Object
- NewRelic::Starter
- Defined in:
- lib/new_relic/starter.rb,
lib/new_relic/starter/rack.rb,
lib/new_relic/starter/rails.rb,
lib/new_relic/starter/version.rb,
ext/new_relic_starter/new_relic_starter.c
Overview
NewRelic::Starter starts the New Relic agent by calling Agent.manual_start.
Defined Under Namespace
Classes: Error, Latch, Rack, Railtie
Constant Summary collapse
- VERSION =
'0.2.0'
Instance Method Summary collapse
-
#initialize(latch) ⇒ NewRelic::Starter
constructor
Return a new Starter object.
-
#start(options = {}) ⇒ Boolean
Starts the new Relic agent if the agent is not started and the latch is opened.
Constructor Details
#initialize(latch) ⇒ NewRelic::Starter
Return a new NewRelic::Starter object.
19 20 21 22 |
# File 'lib/new_relic/starter.rb', line 19 def initialize(latch) @latch = latch @started = false end |
Instance Method Details
#start(options = {}) ⇒ Boolean
Starts the new Relic agent if the agent is not started and the latch is opened.
30 31 32 33 34 35 |
# File 'lib/new_relic/starter.rb', line 30 def start( = {}) return false if @started || !@latch.opened? NewRelic::Agent.manual_start() @started = true end |