class RailsMiniProfiler::Storage

Configure how profiling data is stored within your Rails app.

@!attribute database

@return [Symbol] which database to connect to

@!attribute profiled_requests_table

@return [Symbol] where to store profiled requests

@!attribute traces_table

@return [Symbol] where to store traces

@!attribute flamegraphs_table

@return [Symbol] where to store flamegraphs

Attributes

database[RW]
flamegraphs_table[RW]
profiled_requests_table[RW]
traces_table[RW]

Public Class Methods

configuration() click to toggle source

Construct a new configuration instance

@return [Storage] a new storage configuration

# File lib/rails_mini_profiler/configuration/storage.rb, line 19
def configuration
  @configuration ||= new
end
configure() { |configuration| ... } click to toggle source

Configure how profiling data is stored

@yieldreturn [Storage] a new storage configuration object

# File lib/rails_mini_profiler/configuration/storage.rb, line 26
def configure
  yield(configuration)
  configuration
end
new(**kwargs) click to toggle source
# File lib/rails_mini_profiler/configuration/storage.rb, line 34
def initialize(**kwargs)
  defaults!
  kwargs.each { |key, value| instance_variable_set("@#{key}", value) }
end

Public Instance Methods

defaults!() click to toggle source

Reset the configuration to default values

# File lib/rails_mini_profiler/configuration/storage.rb, line 40
def defaults!
  @database = nil
  @profiled_requests_table = 'rmp_profiled_requests'
  @flamegraphs_table = 'rmp_flamegraphs'
  @traces_table = 'rmp_traces'
end