request-log-analyzer 1.9.0 → 1.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module RequestLogAnalyzer
13
13
 
14
14
  # The current version of request-log-analyzer.
15
15
  # Do not change the value by hand; it will be updated automatically by the gem release script.
16
- VERSION = "1.9.0"
16
+ VERSION = "1.9.1"
17
17
 
18
18
 
19
19
  autoload :Controller, 'request_log_analyzer/controller'
@@ -2,33 +2,33 @@ class RequestLogAnalyzer::FileFormat::Oink < RequestLogAnalyzer::FileFormat::Rai
2
2
  # capture the PID
3
3
  HODEL3000_PROCESSING = /\[(\d+)\]: Processing ((?:\w+::)*\w+)#(\w+)(?: to (\w+))? \(for (#{ip_address}) at (#{timestamp('%Y-%m-%d %H:%M:%S')})\) \[([A-Z]+)\]/
4
4
 
5
- LINE_DEFINITIONS[:processing] = RequestLogAnalyzer::LineDefinition.new(:processing, :header => true,
6
- :teaser => /Processing /,
7
- :regexp => Regexp.union(LINE_DEFINITIONS[:processing].regexp,HODEL3000_PROCESSING),
8
- :captures => [{ :name => :controller, :type => :string }, # Default Rails Processing
5
+ # TODO: fix me!
6
+ line_definition :processing do |line|
7
+ line.header = true
8
+ line.regexp = Regexp.union(LINE_DEFINITIONS[:processing].regexp,HODEL3000_PROCESSING)
9
+ line.captures = [ { :name => :controller, :type => :string }, # Default Rails Processing
9
10
  { :name => :action, :type => :string },
10
11
  { :name => :format, :type => :string, :default => 'html' },
11
12
  { :name => :ip, :type => :string },
12
13
  { :name => :timestamp, :type => :timestamp },
13
14
  { :name => :method, :type => :string },
14
- { :name => :pid, :type => :integer }, # Hodel 3000 Processing w/PID
15
+ { :name => :pid, :type => :integer }, # Hodel 3000 Processing w/PID
15
16
  { :name => :controller, :type => :string },
16
17
  { :name => :action, :type => :string },
17
18
  { :name => :format, :type => :string, :default => 'html' },
18
19
  { :name => :ip, :type => :string },
19
20
  { :name => :timestamp, :type => :timestamp },
20
- { :name => :method, :type => :string }])
21
-
22
- # capture the memory usage
23
- LINE_DEFINITIONS[:memory_usage] = RequestLogAnalyzer::LineDefinition.new(:memory_usage,
24
- :regexp => /\[(\d+)\]: Memory usage: (\d+) /,
25
- :captures => [{ :name => :pid, :type => :integer },{ :name => :memory, :type => :traffic }])
21
+ { :name => :method, :type => :string }]
22
+ end
26
23
 
27
- # capture :memory usage in all line collections
28
- LINE_COLLECTIONS.each { |k,v| LINE_COLLECTIONS[k] << :memory_usage }
24
+ line_definition :memory_usage do |line|
25
+ line.regexp = /\[(\d+)\]: Memory usage: (\d+)/
26
+ line.capture(:pid).as(:integer)
27
+ line.capture(:memory).as(:traffic)
28
+ end
29
29
 
30
30
  report(:append) do |analyze|
31
- analyze.traffic :memory_diff, :category => REQUEST_CATEGORIZER, :title => "Largest Memory Increases", :line_type => :memory_usage
31
+ analyze.traffic :memory_diff, :category => REQUEST_CATEGORIZER, :title => "Largest Memory Increases", :line_type => :memory_usage
32
32
  end
33
33
 
34
34
  # Keep a record of PIDs and their memory usage when validating requests.
@@ -25,9 +25,9 @@ module RequestLogAnalyzer::FileFormat
25
25
  lines.each do |line|
26
26
  line = line.to_sym
27
27
  if LINE_COLLECTIONS.has_key?(line)
28
- LINE_COLLECTIONS[line].each { |l| definitions_hash[l] = LINE_DEFINITIONS[l] }
28
+ LINE_COLLECTIONS[line].each { |l| definitions_hash[l] ||= LINE_DEFINITIONS[l] }
29
29
  elsif LINE_DEFINITIONS.has_key?(line)
30
- definitions_hash[line] = LINE_DEFINITIONS[line]
30
+ definitions_hash[line] ||= LINE_DEFINITIONS[line]
31
31
  else
32
32
  raise "Unrecognized Rails log line name: #{line.inspect}!"
33
33
  end
@@ -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.9.0"
6
- s.date = "2010-09-26"
5
+ s.version = "1.9.1"
6
+ s.date = "2010-09-29"
7
7
 
8
8
  s.rubyforge_project = 'r-l-a'
9
9
 
@@ -29,13 +29,9 @@ Gem::Specification.new do |s|
29
29
 
30
30
  s.add_development_dependency('rake')
31
31
  s.add_development_dependency('rspec')
32
-
32
+
33
33
  s.add_development_dependency('activerecord')
34
34
  s.add_development_dependency('sqlite3-ruby')
35
-
36
- s.add_development_dependency('git')
37
- s.add_development_dependency('gemcutter')
38
-
39
35
 
40
36
  s.authors = ['Willem van Bergen', 'Bart ten Brinke']
41
37
  s.email = ['willem@railsdoctors.com', 'bart@railsdoctors.com']
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: request-log-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 9
9
- - 0
10
- version: 1.9.0
9
+ - 1
10
+ version: 1.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Willem van Bergen
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-26 00:00:00 +02:00
19
+ date: 2010-09-29 00:00:00 +02:00
20
20
  default_executable: request-log-analyzer
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -75,34 +75,6 @@ dependencies:
75
75
  version: "0"
76
76
  type: :development
77
77
  version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: git
80
- prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
90
- type: :development
91
- version_requirements: *id005
92
- - !ruby/object:Gem::Dependency
93
- name: gemcutter
94
- prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
104
- type: :development
105
- version_requirements: *id006
106
78
  description: " Request log analyzer's purpose is to find out how your web application is being used, how it performs and to\n focus your optimization efforts. This tool will parse all requests in the application's log file and aggregate the \n information. Once it is finished parsing the log file(s), it will show the requests that take op most server time \n using various metrics. It can also insert all parsed request information into a database so you can roll your own\n analysis. It supports Rails-, Merb- and Rack-based applications logs, Apache and Amazon S3 access logs and MySQL \n slow query logs out of the box, but file formats of other applications can easily be supported by supplying an \n easy to write log file format definition.\n"
107
79
  email:
108
80
  - willem@railsdoctors.com