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.
-
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
-
#host ⇒ Object
Returns the value of attribute host.
-
#ignore_paths ⇒ Object
Returns the value of attribute ignore_paths.
-
#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.
20 21 22 |
# File 'lib/app_perf_rpm/configuration.rb', line 20 def initialize reload end |
Instance Attribute Details
#agent_disabled ⇒ Object
Returns the value of attribute agent_disabled.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def agent_disabled @agent_disabled end |
#app_root ⇒ Object
Returns the value of attribute app_root.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def app_root @app_root end |
#application_name ⇒ Object
Returns the value of attribute application_name.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def application_name @application_name end |
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def flush_interval @flush_interval end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def host @host end |
#ignore_paths ⇒ Object
Returns the value of attribute ignore_paths.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def ignore_paths @ignore_paths end |
#instrumentation ⇒ Object
Returns the value of attribute instrumentation.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def instrumentation @instrumentation end |
#license_key ⇒ Object
Returns the value of attribute license_key.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def license_key @license_key end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def port @port end |
#sample_rate ⇒ Object
Returns the value of attribute sample_rate.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def sample_rate @sample_rate end |
#sample_threshold ⇒ Object
Returns the value of attribute sample_threshold.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def sample_threshold @sample_threshold end |
#ssl ⇒ Object
Returns the value of attribute ssl.
7 8 9 |
# File 'lib/app_perf_rpm/configuration.rb', line 7 def ssl @ssl end |
Instance Method Details
#reload ⇒ Object
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 49 50 51 52 53 54 55 |
# File 'lib/app_perf_rpm/configuration.rb', line 24 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.flush_interval ||= 60 # In seconds self.agent_disabled ||= default_if_blank(ENV["APP_PERF_AGENT_DISABLED"], false) self.ignore_paths ||= /\/assets/ self.instrumentation = { :rack => { :enabled => true, :backtrace => :app, :source => true, :trace_middleware => false }, :roda => { :enabled => true, :backtrace => :app, :source => true }, :grape => { :enabled => true, :backtrace => :app, :source => true }, :active_record => { :enabled => true, :backtrace => :app, :source => true }, :active_record_import => { :enabled => true, :backtrace => :app, :source => true }, :active_model_serializer => { :enabled => true, :backtrace => :app, :source => true }, :action_view => { :enabled => true, :backtrace => :app, :source => true }, :action_controller => { :enabled => true, :backtrace => :app, :source => true }, :emque_consuming => { :enabled => true, :backtrace => :app, :source => true }, :redis => { :enabled => true, :backtrace => :app, :source => true }, :sequel => { :enabled => true, :backtrace => :app, :source => true }, :sidekiq => { :enabled => true, :backtrace => :app, :source => true }, :sinatra => { :enabled => true, :backtrace => :app, :source => true }, :net_http => { :enabled => true, :backtrace => :app, :source => true }, :typhoeus => { :enabled => true, :backtrace => :app, :source => true }, :faraday => { :enabled => true, :backtrace => :app, :source => true } } end end |