class ScoutApm::FrameworkIntegrations::Sinatra

Public Instance Methods

application_name() click to toggle source
# 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.message}\n#{e.backtrace.join("\n\t")}"
  "Sinatra"
end
database_engine() click to toggle source

TODO: Figure out how to detect this smarter

# File lib/scout_apm/framework_integrations/sinatra.rb, line 37
def database_engine
  :mysql
end
env() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 32
def env
  ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
end
human_name() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 8
def human_name
  "Sinatra"
end
name() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 4
def name
  :sinatra
end
present?() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 16
def present?
  defined?(::Sinatra) && defined?(::Sinatra::Base)
end
raw_database_adapter() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 41
def raw_database_adapter
  :mysql
end
version() click to toggle source
# File lib/scout_apm/framework_integrations/sinatra.rb, line 12
def version
  ::Sinatra::VERSION
end