Sha256: ec4e0df72bd7e3ecb9d311d5426f0741ff05d804c5e5bc391a1d2a37d366dd69
Contents?: true
Size: 1.31 KB
Versions: 11
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true module RailsMiniProfiler # 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 class Storage class << self # Construct a new configuration instance # # @return [Storage] a new storage configuration def configuration @configuration ||= new end # Configure how profiling data is stored # # @yieldreturn [Storage] a new storage configuration object def configure yield(configuration) configuration end end attr_accessor :database, :profiled_requests_table, :traces_table, :flamegraphs_table def initialize(**kwargs) defaults! kwargs.each { |key, value| instance_variable_set("@#{key}", value) } end # Reset the configuration to default values def defaults! @database = nil @profiled_requests_table = 'rmp_profiled_requests' @flamegraphs_table = 'rmp_flamegraphs' @traces_table = 'rmp_traces' end end end
Version data entries
11 entries across 11 versions & 1 rubygems