request-log-analyzer 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a simple command line tool to analyze request log files in various formats to produce a performance report. Its purpose is to find what actions are best candidates for optimization.
4
4
 
5
- * Analyzes Rails request logs, Merb request logs, Apache access logs and more, or parses any other log format you specify.
5
+ * Analyzes log files. Currently supports: Amazon S3, Apache, Delayed::Job, Merb, Mysql, PostgreSQL, Rack, Rails and more.
6
6
  * Combines multiple files and decompresses compressed files, which comes in handy if you are using logrotate.
7
7
  * Uses several metrics, including cumulative request time, mean request time, process blockers, database and rendering time, HTTP methods and statuses, Rails action cache statistics, etc.) (Sample output: http://wiki.github.com/wvanbergen/request-log-analyzer/sample-output)
8
8
  * Low memory footprint and reasonably fast, so it is safe to run on a production server.
@@ -35,5 +35,4 @@ Bergen (willem@railsdoctors.com) or Bart ten Brinke (bart@railsdoctors.com).
35
35
 
36
36
  * Project wiki at GitHub: http://wiki.github.com/wvanbergen/request-log-analyzer
37
37
  * railsdoctors homepage: http://railsdoctors.com
38
- * wvanbergen's blog posts: http://techblog.floorplanner.com/tag/request-log-analyzer
39
- * barttenbrinke's blog posts: http://movesonrails.com/articles/tag/analyzer
38
+ * wvanbergen's blog posts: http://techblog.floorplanner.com/tag/request-log-analyzer
@@ -11,7 +11,7 @@ module RequestLogAnalyzer
11
11
 
12
12
  # The current version of request-log-analyzer.
13
13
  # Do not change the value by hand; it will be updated automatically by the gem release script.
14
- VERSION = "1.6.1"
14
+ VERSION = "1.6.2"
15
15
 
16
16
  # Loads constants in the RequestLogAnalyzer namespace using self.load_default_class_file(base, const)
17
17
  # <tt>const</tt>:: The constant that is not yet loaded in the RequestLogAnalyzer namespace. This should be passed as a string or symbol.
@@ -63,7 +63,7 @@ module RequestLogAnalyzer::FileFormat
63
63
 
64
64
  parsers = all_formats.map { |f| RequestLogAnalyzer::Source::LogParser.new(f, :parse_strategy => 'cautious') }
65
65
 
66
- File.open(file, 'r') do |io|
66
+ File.open(file, 'rb') do |io|
67
67
  while io.lineno < line_count && (line = io.gets)
68
68
  parsers.each { |parser| parser.parse_line(line) }
69
69
  end
@@ -66,6 +66,8 @@ module RequestLogAnalyzer
66
66
  else
67
67
  return false
68
68
  end
69
+ rescue
70
+ return false
69
71
  end
70
72
 
71
73
  alias :=~ :matches
@@ -109,12 +109,12 @@ module RequestLogAnalyzer::Source
109
109
  @progress_handler = @dormant_progress_handler
110
110
  @progress_handler.call(:started, file) if @progress_handler
111
111
 
112
- File.open(file, 'r') { |f| parse_io(f, options, &block) }
112
+ File.open(file, 'rb') { |f| parse_io(f, options, &block) }
113
113
 
114
114
  @progress_handler.call(:finished, file) if @progress_handler
115
115
  @progress_handler = nil
116
116
  else
117
- IO.popen(decompress_file?(file), 'r') { |f| parse_io(f, options, &block) }
117
+ IO.popen(decompress_file?(file), 'rb') { |f| parse_io(f, options, &block) }
118
118
  end
119
119
 
120
120
  @source_changes_handler.call(:finished, @current_source) if @source_changes_handler
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
2
2
  s.name = "request-log-analyzer"
3
3
 
4
4
  # Do not set the version and date field manually, this is done by the release script
5
- s.version = "1.6.1"
6
- s.date = "2010-01-16"
5
+ s.version = "1.6.2"
6
+ s.date = "2010-01-29"
7
7
 
8
8
  s.rubyforge_project = 'r-l-a'
9
9
 
@@ -46,7 +46,7 @@ describe RequestLogAnalyzer::Source::LogParser, :requests do
46
46
  end
47
47
 
48
48
  it "should parse a stream and find valid requests" do
49
- io = File.new(log_fixture(:test_file_format), 'r')
49
+ io = File.new(log_fixture(:test_file_format), 'rb')
50
50
  @log_parser.parse_io(io) do |request|
51
51
  request.should be_kind_of(RequestLogAnalyzer::Request)
52
52
  request.should =~ :test
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request-log-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willem van Bergen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-16 00:00:00 +01:00
13
+ date: 2010-01-29 00:00:00 +01:00
14
14
  default_executable: request-log-analyzer
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency