Permalink
Browse files

Reverting w/updated example log

  • Loading branch information...
1 parent 7597785 commit e172cc7e7aaedbb1dccdff2d8fc184b41c006f0a @itsderek23 itsderek23 committed Oct 5, 2010
Showing with 3 additions and 7 deletions.
  1. +0 −2 apache_analyzer/apache_analyzer.rb
  2. +1 −3 apache_analyzer/test.rb
  3. +2 −2 apache_analyzer/unrecognized_line.log
@@ -154,8 +154,6 @@ def parse_line(line)
end
end # checking if the request is past the last request time
end # timestamp check
- else
- return nil
end # if matches
return true
end # def parse_line
View
@@ -25,15 +25,13 @@ def test_initial_run_with_utc
end
end
- # Should not continue scanning if a line does not match the specified format. This is
- # to prevent potential long runs of the plugin if the specified format is wrong.
def test_run_with_unrecognized_line
log = File.dirname(__FILE__)+"/unrecognized_line.log"
time = Time.parse(@last_request_time)
Timecop.travel(time) do
plugin=ApacheAnalyzer.new(nil,{},{:log => log, :format => @duration_format})
res = plugin.run()
- assert_equal 2, res[:reports].first[:lines_scanned]
+ assert_equal 3, res[:reports].first[:lines_scanned]
assert_equal 0.06.to_s, res[:reports].first[:average_request_length]
# note - this is stored in the timezone of this server
assert_equal Time.parse("Sun Apr 11 17:22:04 -0700 2010"), res[:memory][:last_request_time]
@@ -1,3 +1,3 @@
-69.171.231.0 - - [11/Apr/2010:17:21:59 +0000] "GET /users/events/3 HTTP/1.1" 200 2586 89676
-BLAH!!!
+69.171.231.0 - - [11/Apr/2010:17:21:59 +0000] "GET /users/events/3 HTTP/1.1" 200 2586 59676
+facebook.com - - - [11/Apr/2010:17:22:02 +0000]] "HEAD /ping HTTP/1.0" 200 - 3245
69.171.231.0 - - [11/Apr/2010:17:22:04 +0000] "GET /users/events/3 HTTP/1.1" 200 2586 56734

0 comments on commit e172cc7

Please sign in to comment.