Class: AppPerfRpm::Configuration
- Inherits:
-
Object
- Object
- AppPerfRpm::Configuration
- Defined in:
- lib/app_perf_rpm/configuration.rb
Instance Attribute Summary collapse
-
#agent_disabled ⇒ Object
Returns the value of attribute agent_disabled.
-
#app_root ⇒ Object
Returns the value of attribute app_root.
-
#application_name ⇒ Object
Returns the value of attribute application_name.
-
#dispatch_interval ⇒ Object
Returns the value of attribute dispatch_interval.
-
#host ⇒ Object
Returns the value of attribute host.
-
#instrumentation ⇒ Object
Returns the value of attribute instrumentation.
-
#license_key ⇒ Object
Returns the value of attribute license_key.
-
#port ⇒ Object
Returns the value of attribute port.
-
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
-
#sample_threshold ⇒ Object
Returns the value of attribute sample_threshold.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reload ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 |
# File 'lib/app_perf_rpm/configuration.rb', line 17 def initialize reload end |
Instance Attribute Details
#agent_disabled ⇒ Object
Returns the value of attribute agent_disabled.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def agent_disabled @agent_disabled end |
#app_root ⇒ Object
Returns the value of attribute app_root.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def app_root @app_root end |
#application_name ⇒ Object
Returns the value of attribute application_name.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def application_name @application_name end |
#dispatch_interval ⇒ Object
Returns the value of attribute dispatch_interval.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def dispatch_interval @dispatch_interval end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def host @host end |
#instrumentation ⇒ Object
Returns the value of attribute instrumentation.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def instrumentation @instrumentation end |
#license_key ⇒ Object
Returns the value of attribute license_key.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def license_key @license_key end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def port @port end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def sample_rate @sample_rate end |
#sample_threshold ⇒ Object
Returns the value of attribute sample_threshold.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def sample_threshold @sample_threshold end |
#ssl ⇒ Object
Returns the value of attribute ssl.
5 6 7 |
# File 'lib/app_perf_rpm/configuration.rb', line 5 def ssl @ssl end |
Instance Method Details
#reload ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/app_perf_rpm/configuration.rb', line 21 def reload ::AppPerfRpm.mutex.synchronize do self.app_root = app_root ? Pathname.new(app_root.to_s) : nil self.host ||= default_if_blank(ENV["APP_PERF_HOST"], "http://localhost:5000") self.ssl ||= false self.license_key ||= default_if_blank(ENV["APP_PERF_LICENSE_KEY"], nil) self.application_name ||= "Default" self.sample_rate ||= 10 # Percentage of request to sample self.sample_threshold ||= 0 # Minimum amount of duration to sample self.dispatch_interval ||= 60 # In seconds self.agent_disabled ||= default_if_blank(ENV["APP_PERF_AGENT_DISABLED"], false) self.instrumentation = { :rack => { :enabled => true, :backtrace => false, :trace_middleware => true }, :active_record => { :enabled => true, :backtrace => false }, :active_record_import => { :enabled => true, :backtrace => false }, :action_view => { :enabled => true, :backtrace => false }, :action_controller => { :enabled => true, :backtrace => false }, :emque_consuming => { :enabled => true, :backtrace => false }, :redis => { :enabled => true, :backtrace => false }, :sequel => { :enabled => true, :backtrace => false }, :sidekiq => { :enabled => true, :backtrace => false }, :sinatra => { :enabled => true, :backtrace => false }, :net_http => { :enabled => true, :backtrace => false }, :typhoeus => { :enabled => true, :backtrace => false }, :faraday => { :enabled => true, :backtrace => false } } end end |