Class: ScoutApm::FrameworkIntegrations::Sinatra
- Inherits:
-
Object
- Object
- ScoutApm::FrameworkIntegrations::Sinatra
- Defined in:
- lib/scout_apm/framework_integrations/sinatra.rb
Instance Method Summary collapse
- #application_name ⇒ Object
-
#database_engine ⇒ Object
TODO: Figure out how to detect this smarter.
- #env ⇒ Object
- #human_name ⇒ Object
- #name ⇒ Object
- #present? ⇒ Boolean
- #raw_database_adapter ⇒ Object
- #version ⇒ Object
Instance Method Details
#application_name ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 20 def application_name possible = ObjectSpace.each_object(Class).select { |klass| klass < ::Sinatra::Base } - [::Sinatra::Application] if possible.length == 1 possible.first.name else "Sinatra" end rescue => e ScoutApm::Agent.instance.context.logger.debug "Failed getting Sinatra Application Name: #{e.}\n#{e.backtrace.join("\n\t")}" "Sinatra" end |
#database_engine ⇒ Object
TODO: Figure out how to detect this smarter
37 38 39 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 37 def database_engine :mysql end |
#env ⇒ Object
32 33 34 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 32 def env ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development' end |
#human_name ⇒ Object
8 9 10 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 8 def human_name "Sinatra" end |
#name ⇒ Object
4 5 6 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 4 def name :sinatra end |
#present? ⇒ Boolean
16 17 18 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 16 def present? defined?(::Sinatra) && defined?(::Sinatra::Base) end |
#raw_database_adapter ⇒ Object
41 42 43 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 41 def raw_database_adapter :mysql end |
#version ⇒ Object
12 13 14 |
# File 'lib/scout_apm/framework_integrations/sinatra.rb', line 12 def version ::Sinatra::VERSION end |