Sha256: 7f33911a41a2bdf244d811f495c55cd05c91379b5d5ef7ad4a1fde87e852c6f7

Contents?: true

Size: 1006 Bytes

Versions: 2

Compression:

Stored size: 1006 Bytes

Contents

class SpecFormat < 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.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

2 entries across 2 versions & 2 rubygems

Version Path
wvanbergen-request-log-analyzer-1.1.2 spec/file_formats/spec_format.rb
request-log-analyzer-1.1.2 spec/file_formats/spec_format.rb