Sha256: 026e0f1a6ec43592cd20b55f2a02bf2f0591184716f202cfd3f2832a007ef085

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

module RequestLogAnalyzer::FileFormat
  
  class Merb < Base

    # ~ Started request handling: Fri Aug 29 11:10:23 +0200 2008
    line_definition :started do |line|
      line.header = true
      line.teaser = /Started/
      line.regexp = /Started request handling\:\ (.+)/
      line.captures << { :name => :timestamp, :type => :timestamp }
    end    
    
    # ~ Params: {"action"=>"create", "controller"=>"session"}
    # ~ Params: {"_method"=>"delete", "authenticity_token"=>"[FILTERED]", "action"=>"d}
    line_definition :params do |line|
      line.teaser = /Params/
      line.regexp = /Params\:\ \{(.+)\}/
      line.captures << { :name => :raw_hash, :type => :string}
    end

    # ~ {:dispatch_time=>0.006117, :after_filters_time=>6.1e-05, :before_filters_time=>0.000712, :action_time=>0.005833}
    line_definition :completed do |line|
      line.footer = true
      line.teaser = /\{:dispatch_time/
      line.regexp = /\{\:dispatch_time=>(\d+\.\d+(?:e-?\d+)?), (?:\:after_filters_time=>(\d+\.\d+(?:e-?\d+)?), )?(?:\:before_filters_time=>(\d+\.\d+(?:e-?\d+)?), )?\:action_time=>(\d+\.\d+(?:e-?\d+)?)\}/
      line.captures << { :name => :dispatch_time,       :type => :duration } \
                    << { :name => :after_filters_time,  :type => :duration } \
                    << { :name => :before_filters_time, :type => :duration } \
                    << { :name => :action_time,         :type => :duration }
    end
    
    
    report do |analyze|
      # FIX ME
    end
    
  end

end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.1.2 lib/request_log_analyzer/file_format/merb.rb
request-log-analyzer-1.1.2 lib/request_log_analyzer/file_format/merb.rb