Class: ManageEngine::Instrumentation::PumaWorker

Inherits:
Object
  • Object
show all
Defined in:
lib/agent/server/instrument/puma.rb

Instance Method Summary collapse

Instance Method Details

#envObject



13
14
15
# File 'lib/agent/server/instrument/puma.rb', line 13

def env
  ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
end

#instrumentObject



21
22
23
24
25
26
27
28
# File 'lib/agent/server/instrument/puma.rb', line 21

def instrument
  ManageEngine::APMObjectHolder.instance.log.info "Instrumenting Puma server workers. Version: #{version}"
    Puma::Server.class_eval do
        include ManageEngine::Instrumentation::PumaRun
        alias original_run run
        alias run agent_run
    end
end

#nameObject



17
18
19
# File 'lib/agent/server/instrument/puma.rb', line 17

def name
  'Puma Worker'
end

#present?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/agent/server/instrument/puma.rb', line 5

def present?
  defined?(Puma::Server)
end

#versionObject



9
10
11
# File 'lib/agent/server/instrument/puma.rb', line 9

def version
  Puma::Const::PUMA_VERSION
end