Module: RailsPerformance

Defined in:
lib/rails_performance.rb,
lib/rails_performance/utils.rb,
lib/rails_performance/engine.rb,
lib/rails_performance/version.rb,
lib/rails_performance/data_source.rb,
lib/rails_performance/gems/rake_ext.rb,
lib/rails_performance/gems/grape_ext.rb,
lib/rails_performance/gems/custom_ext.rb,
lib/rails_performance/extensions/trace.rb,
lib/rails_performance/extensions/trace.rb,
lib/rails_performance/gems/sidekiq_ext.rb,
lib/rails_performance/rails/middleware.rb,
lib/rails_performance/models/collection.rb,
lib/rails_performance/models/base_record.rb,
lib/rails_performance/models/rake_record.rb,
lib/rails_performance/models/grape_record.rb,
lib/rails_performance/models/trace_record.rb,
lib/rails_performance/rails/query_builder.rb,
lib/rails_performance/reports/base_report.rb,
lib/rails_performance/gems/delayed_job_ext.rb,
lib/rails_performance/models/custom_record.rb,
lib/rails_performance/reports/crash_report.rb,
lib/rails_performance/reports/trace_report.rb,
lib/rails_performance/models/request_record.rb,
lib/rails_performance/models/sidekiq_record.rb,
lib/rails_performance/models/resource_record.rb,
lib/rails_performance/thread/current_request.rb,
lib/rails_performance/reports/requests_report.rb,
lib/rails_performance/reports/breakdown_report.rb,
lib/rails_performance/reports/resources_report.rb,
lib/rails_performance/models/delayed_job_record.rb,
lib/rails_performance/reports/percentile_report.rb,
lib/rails_performance/reports/throughput_report.rb,
app/controllers/rails_performance/base_controller.rb,
lib/rails_performance/extensions/resources_monitor.rb,
lib/rails_performance/instrument/metrics_collector.rb,
lib/rails_performance/reports/response_time_report.rb,
lib/rails_performance/reports/slow_requests_report.rb,
lib/rails_performance/reports/recent_requests_report.rb,
app/helpers/rails_performance/rails_performance_helper.rb,
app/controllers/rails_performance/concerns/csv_exportable.rb,
app/controllers/rails_performance/rails_performance_controller.rb

Defined Under Namespace

Modules: Concerns, Extensions, Gems, Instrument, Models, Rails, RailsPerformanceHelper, Reports Classes: BaseController, CurrentRequest, DataSource, Engine, InstallGenerator, RailsPerformanceController, Utils

Constant Summary collapse

FORMAT =
"%Y%m%dT%H%M"
VERSION =
"1.4.1"
SCHEMA =
"1.0.2"
@@redis =
Redis.new
@@duration =
4.hours
@@recent_requests_time_window =
60.minutes
@@recent_requests_limit =
500
@@slow_requests_time_window =
4.hours
@@slow_requests_threshold =
500
@@debug =
false
@@enabled =
true
@@mount_at =
"/rails/performance"
@@http_basic_authentication_enabled =
false
@@http_basic_authentication_user_name =
"rails_performance"
@@http_basic_authentication_password =
"password12"
@@verify_access_proc =
proc { |controller| true }
@@ignored_endpoints =
[]
@@ignored_paths =
[]
@@skip =
false
"/"
@@skipable_rake_tasks =
[]
@@custom_data_proc =
nil
@@include_rake_tasks =
false
@@include_custom_events =
true
@@ignore_trace_headers =
["datetimei"]
@@system_monitor_duration =
24.hours
@@_resource_monitor =
nil
@@_running_mode =
nil
@@_resource_monitor_enabled =
false

Class Method Summary collapse

Class Method Details

.ignored_endpoints=(endpoints) ⇒ Object



83
84
85
# File 'lib/rails_performance.rb', line 83

def self.ignored_endpoints=(endpoints)
  @@ignored_endpoints = Set.new(endpoints)
end

.ignored_paths=(paths) ⇒ Object



89
90
91
# File 'lib/rails_performance.rb', line 89

def self.ignored_paths=(paths)
  @@ignored_paths = Set.new(paths)
end

.log(message) ⇒ Object



145
146
147
148
149
150
151
152
153
154
# File 'lib/rails_performance.rb', line 145

def self.log(message)
  return unless RailsPerformance.debug

  if ::Rails.logger
    # puts(message)
    ::Rails.logger.debug(message)
  else
    puts(message)
  end
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



141
142
143
# File 'lib/rails_performance.rb', line 141

def self.setup
  yield(self)
end