Sha256: 3ece8e9bf62b4e34d62090bc88f28434bd0fd01aa18c59759207116300fcac4a

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

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
  
  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

11 entries across 11 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.1.3 spec/lib/testing_format.rb
wvanbergen-request-log-analyzer-1.1.4 spec/lib/testing_format.rb
wvanbergen-request-log-analyzer-1.1.5.1 spec/lib/testing_format.rb
wvanbergen-request-log-analyzer-1.1.6 spec/lib/testing_format.rb
wvanbergen-request-log-analyzer-1.1.7 spec/lib/testing_format.rb
wvanbergen-request-log-analyzer-1.2.0 spec/lib/testing_format.rb
request-log-analyzer-1.2.0 spec/lib/testing_format.rb
request-log-analyzer-1.1.6 spec/lib/testing_format.rb
request-log-analyzer-1.1.5.1 spec/lib/testing_format.rb
request-log-analyzer-1.1.4 spec/lib/testing_format.rb
request-log-analyzer-1.1.3 spec/lib/testing_format.rb