class WprofGenerator
Public Instance Methods
wor_prof_init()
click to toggle source
# File lib/generators/wprof_generator.rb, line 3 def wor_prof_init create_file 'config/initializers/wprof.rb', init_wprof end
Private Instance Methods
init_wprof()
click to toggle source
# File lib/generators/wprof_generator.rb, line 9 def init_wprof <<~CONTENT # ----------------------------------------- # Uncomment and set for use custom options. # ----------------------------------------- WProf::Configuration.configure do |config| ## Save DB Runtime?: Default: true # config.db_runtime = true ## Reporter Type (¿When we will save our data?): 'LOGGER' by default. ## Another options: 'FILE' (For CSV), 'DATABASE' (For Rails DB), 'EXTERNAL' (For external API). # config.reporter_type = 'LOGGER' ## CSV Type (One CSV file for each type of data or all together) ## 'SPLIT' by default, Options: 'MIX' # config.csv_type = 'SPLIT' ## Reporter must be work async? Default: false # config.async = false ## Httparty Methods to wrapper. # config.httparty_methods_to_trace = ['get', 'put', 'delete', 'post'] ## External URL for hit when Reporter Type is EXTERNAL ## DEFAULT: nil # config.external_url = 'http://example-url/reporter' ## Define Headers for Reporter Type when is EXTERNAL. ## Must be a Hash (see HTTPARTY doc for more info) ## DEFAULT: nil # config.external_headers = { headers: {'User-Agent' => 'Httparty'}} ## Define your Custom Methods here! (Must be an Array) # config.custom_methods = [ 'my_great_method' ] ## Define your own path for save Files when Reporter Type is FILE ## By default Wor-Prof use Rails.root # config.file_path = '/home/mcolombo/examplefolder' ## Enable/Disable Wprof ## Default: false # config.disable_wprof = false end CONTENT end