Sha256: 95eff52cc97afd11d9ffa2482a646b50b51dcceb98791c8558d77bba0645251b

Contents?: true

Size: 1.37 KB

Versions: 47

Compression:

Stored size: 1.37 KB

Contents

# Simple log file specification, used to test log parser.
class TestingFormat < RequestLogAnalyzer::FileFormat::Base

  format_definition.first do |line|
    line.header = true
    line.teaser = /processing /
    line.regexp = /processing request (\d+)/
    line.captures = [{ :name => :request_no, :type => :integer }]
  end

  format_definition.test do |line|
    line.teaser = /testing /
    line.regexp = /testing is (\w+)(?: in (\d+\.\d+)ms)?/
    line.captures = [{ :name => :test_capture, :type => :test_type },
                     { :name => :duration, :type => :duration, :unit => :msec }]
  end

  format_definition.eval do |line|
    line.regexp = /evaluation (\{.*\})/
    line.captures = [{ :name => :evaluated, :type => :eval, :provides => { :greating => :string, :what => :string } }]
  end

  format_definition.last do |line|
    line.footer = true
    line.teaser = /finishing /
    line.regexp = /finishing request (\d+)/
    line.captures = [{ :name => :request_no, :type => :integer }]
  end

  format_definition.combined do |line|
    line.header = true
    line.footer = true
    line.regexp = /this is a header and footer line/
  end

  report do |analyze|
    analyze.frequency :test_capture, :title => 'What is testing exactly?'
  end

  class Request < RequestLogAnalyzer::Request
    def convert_test_type(value, definition)
      "Testing is #{value}"
    end
  end

end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
request-log-analyzer-1.13.1 spec/lib/testing_format.rb
request-log-analyzer-1.13.0 spec/lib/testing_format.rb
request-log-analyzer-1.12.11 spec/lib/testing_format.rb
request-log-analyzer-1.12.10 spec/lib/testing_format.rb
request-log-analyzer-1.12.9 spec/lib/testing_format.rb
request-log-analyzer-1.12.8 spec/lib/testing_format.rb
request-log-analyzer-1.12.7 spec/lib/testing_format.rb
request-log-analyzer-1.12.6 spec/lib/testing_format.rb
request-log-analyzer-1.12.5 spec/lib/testing_format.rb
request-log-analyzer-1.12.4 spec/lib/testing_format.rb
request-log-analyzer-1.12.3 spec/lib/testing_format.rb
request-log-analyzer-1.12.2 spec/lib/testing_format.rb
request-log-analyzer-1.12.1 spec/lib/testing_format.rb
request-log-analyzer-1.12.0 spec/lib/testing_format.rb
request-log-analyzer-1.11.1 spec/lib/testing_format.rb
request-log-analyzer-1.11.0 spec/lib/testing_format.rb
request-log-analyzer-1.10.1 spec/lib/testing_format.rb
request-log-analyzer-1.10.0 spec/lib/testing_format.rb
request-log-analyzer-1.9.10 spec/lib/testing_format.rb
request-log-analyzer-1.9.9 spec/lib/testing_format.rb