request-log-analyzer 1.12.3 → 1.12.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cli/tools.rb +2 -2
- data/lib/request_log_analyzer.rb +1 -1
- data/request-log-analyzer.gemspec +3 -3
- data/spec/lib/mocks.rb +3 -4
- data/tasks/request_log_analyzer.rake +22 -7
- metadata +71 -65
data/lib/cli/tools.rb
CHANGED
@@ -32,10 +32,10 @@ end
|
|
32
32
|
# Raises if it cannot find the project folder or if the install_type is now known.
|
33
33
|
def install_rake_tasks(install_type = :rails)
|
34
34
|
if install_type.to_sym == :rails
|
35
|
-
require '
|
35
|
+
require 'fileutils'
|
36
36
|
if File.directory?('./lib/tasks/')
|
37
37
|
task_file = File.expand_path('../../tasks/request_log_analyzer.rake', File.dirname(__FILE__))
|
38
|
-
|
38
|
+
FileUtils.copy(task_file, './lib/tasks/request_log_analyze.rake')
|
39
39
|
puts "Installed rake tasks."
|
40
40
|
puts "To use, run: rake rla:report"
|
41
41
|
else
|
data/lib/request_log_analyzer.rb
CHANGED
@@ -10,7 +10,7 @@ module RequestLogAnalyzer
|
|
10
10
|
|
11
11
|
# The current version of request-log-analyzer.
|
12
12
|
# Do not change the value by hand; it will be updated automatically by the gem release script.
|
13
|
-
VERSION = "1.12.
|
13
|
+
VERSION = "1.12.4"
|
14
14
|
|
15
15
|
# Convert a string/symbol in camelcase ({RequestLogAnalyzer::Controller}) to underscores
|
16
16
|
# (<tt>request_log_analyzer/controller</tt>). This function can be used to load the file (using
|
@@ -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.12.
|
6
|
-
s.date = "2012-
|
5
|
+
s.version = "1.12.4"
|
6
|
+
s.date = "2012-08-05"
|
7
7
|
|
8
8
|
s.rubyforge_project = 'r-l-a'
|
9
9
|
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.requirements << "To use the database inserter, ActiveRecord and an appropriate database adapter are required."
|
29
29
|
|
30
30
|
s.add_development_dependency('rake')
|
31
|
-
s.add_development_dependency('rspec', '
|
31
|
+
s.add_development_dependency('rspec', '~> 2.8')
|
32
32
|
|
33
33
|
s.add_development_dependency('activerecord')
|
34
34
|
|
data/spec/lib/mocks.rb
CHANGED
@@ -14,10 +14,9 @@ module RequestLogAnalyzer::RSpec::Mocks
|
|
14
14
|
source.stub!(:prepare)
|
15
15
|
source.stub!(:finalize)
|
16
16
|
|
17
|
-
source.stub!(:each_request).
|
18
|
-
|
19
|
-
|
20
|
-
end
|
17
|
+
source.stub!(:each_request).
|
18
|
+
and_yield(testing_format.request(:field => 'value1')).
|
19
|
+
and_yield(testing_format.request(:field => 'value2'))
|
21
20
|
|
22
21
|
return source
|
23
22
|
end
|
@@ -1,25 +1,40 @@
|
|
1
1
|
namespace :rla do
|
2
2
|
desc "Analyze the Rails log file using the request-log-analyzer gem."
|
3
3
|
task :report => :environment do
|
4
|
+
rails_env = defined?(RAILS_ENV) ? RAILS_ENV : Rails.env
|
5
|
+
rails_root = defined?(RAILS_ROOT) ? RAILS_ROOT : Rails.root
|
6
|
+
rails_version = Rails.version.split(".").first.to_i
|
7
|
+
|
8
|
+
log_file = defined?(Rails.configuration.log_path) ? Rails.configuration.log_path : Rails.configuration.paths["log"].first
|
9
|
+
log_format = rails_version > 2 ? "rails3" : "rails"
|
10
|
+
|
4
11
|
puts "Analyzing the Rails log file using the request-log-analyzer gem."
|
5
|
-
puts " Environment: #{
|
6
|
-
puts " Logfile: #{
|
12
|
+
puts " Environment: #{rails_env}"
|
13
|
+
puts " Logfile: #{log_file}"
|
7
14
|
puts ""
|
8
|
-
IO.popen("request-log-analyzer #{Rails.configuration.log_path}") { |io| $stdout << io.read }
|
9
15
|
|
16
|
+
IO.popen("request-log-analyzer #{log_file} --format #{log_format}") { |io| $stdout << io.read }
|
10
17
|
end
|
11
18
|
|
12
19
|
namespace :report do
|
13
20
|
desc "Analyze the Rails log file using the request-log-analyzer gem and output an HTML file."
|
14
21
|
task :html => :environment do
|
15
|
-
|
22
|
+
rails_env = defined?(RAILS_ENV) ? RAILS_ENV : Rails.env
|
23
|
+
rails_root = defined?(RAILS_ROOT) ? RAILS_ROOT : Rails.root
|
24
|
+
rails_version = Rails.version.split(".").first.to_i
|
25
|
+
|
26
|
+
log_file = defined?(Rails.configuration.log_path) ? Rails.configuration.log_path : Rails.configuration.paths["log"].first
|
27
|
+
log_format = rails_version > 2 ? "rails3" : "rails"
|
28
|
+
|
29
|
+
output_file = File.join(rails_root, 'public', 'performance.html')
|
16
30
|
|
17
31
|
puts "Analyzing the Rails log file using the request-log-analyzer gem."
|
18
|
-
puts " Environment: #{
|
19
|
-
puts " Logfile: #{
|
32
|
+
puts " Environment: #{rails_env}"
|
33
|
+
puts " Logfile: #{log_file}"
|
20
34
|
puts " Output: #{output_file}"
|
21
35
|
puts ""
|
22
|
-
|
36
|
+
|
37
|
+
IO.popen("request-log-analyzer #{log_file} --output HTML --file #{output_file} --format #{log_format}") { |io| $stdout << io.read }
|
23
38
|
end
|
24
39
|
end
|
25
40
|
|
metadata
CHANGED
@@ -1,74 +1,80 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: request-log-analyzer
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.12.4
|
4
5
|
prerelease:
|
5
|
-
version: 1.12.3
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Willem van Bergen
|
9
9
|
- Bart ten Brinke
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
dependencies:
|
17
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-08-05 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
18
16
|
name: rake
|
19
|
-
|
20
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70130940523300 !ruby/object:Gem::Requirement
|
21
18
|
none: false
|
22
|
-
requirements:
|
23
|
-
- -
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version:
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
26
23
|
type: :development
|
27
|
-
version_requirements: *id001
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: rspec
|
30
24
|
prerelease: false
|
31
|
-
|
25
|
+
version_requirements: *70130940523300
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
requirement: &70130940522420 !ruby/object:Gem::Requirement
|
32
29
|
none: false
|
33
|
-
requirements:
|
34
|
-
- -
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 2.8
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.8'
|
37
34
|
type: :development
|
38
|
-
version_requirements: *id002
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
|
-
name: activerecord
|
41
35
|
prerelease: false
|
42
|
-
|
36
|
+
version_requirements: *70130940522420
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: activerecord
|
39
|
+
requirement: &70130940521320 !ruby/object:Gem::Requirement
|
43
40
|
none: false
|
44
|
-
requirements:
|
45
|
-
- -
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version:
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
48
45
|
type: :development
|
49
|
-
version_requirements: *id003
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: sqlite3
|
52
46
|
prerelease: false
|
53
|
-
|
47
|
+
version_requirements: *70130940521320
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: sqlite3
|
50
|
+
requirement: &70130940520020 !ruby/object:Gem::Requirement
|
54
51
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version:
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
59
56
|
type: :development
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70130940520020
|
59
|
+
description: ! " Request log analyzer's purpose is to find out how your web application
|
60
|
+
is being used, how it performs and to\n focus your optimization efforts. This
|
61
|
+
tool will parse all requests in the application's log file and aggregate the \n
|
62
|
+
\ information. Once it is finished parsing the log file(s), it will show the requests
|
63
|
+
that take op most server time \n using various metrics. It can also insert all
|
64
|
+
parsed request information into a database so you can roll your own\n analysis.
|
65
|
+
It supports Rails-, Merb- and Rack-based applications logs, Apache and Amazon S3
|
66
|
+
access logs and MySQL \n slow query logs out of the box, but file formats of
|
67
|
+
other applications can easily be supported by supplying an \n easy to write log
|
68
|
+
file format definition.\n"
|
69
|
+
email:
|
63
70
|
- willem@railsdoctors.com
|
64
71
|
- bart@railsdoctors.com
|
65
|
-
executables:
|
72
|
+
executables:
|
66
73
|
- request-log-analyzer
|
67
74
|
extensions: []
|
68
|
-
|
69
|
-
extra_rdoc_files:
|
75
|
+
extra_rdoc_files:
|
70
76
|
- README.rdoc
|
71
|
-
files:
|
77
|
+
files:
|
72
78
|
- .gitignore
|
73
79
|
- .infinity_test
|
74
80
|
- .travis.yml
|
@@ -211,40 +217,40 @@ files:
|
|
211
217
|
- spec/unit/tracker/traffic_tracker_spec.rb
|
212
218
|
- tasks/github-gem.rake
|
213
219
|
- tasks/request_log_analyzer.rake
|
214
|
-
has_rdoc: true
|
215
220
|
homepage: http://railsdoctors.com
|
216
221
|
licenses: []
|
217
|
-
|
218
222
|
post_install_message:
|
219
|
-
rdoc_options:
|
223
|
+
rdoc_options:
|
220
224
|
- --title
|
221
225
|
- request-log-analyzer
|
222
226
|
- --main
|
223
227
|
- README.rdoc
|
224
228
|
- --line-numbers
|
225
229
|
- --inline-source
|
226
|
-
require_paths:
|
230
|
+
require_paths:
|
227
231
|
- lib
|
228
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
229
233
|
none: false
|
230
|
-
requirements:
|
231
|
-
- -
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version:
|
234
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - ! '>='
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
238
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
239
|
none: false
|
236
|
-
requirements:
|
237
|
-
- -
|
238
|
-
- !ruby/object:Gem::Version
|
239
|
-
version:
|
240
|
-
requirements:
|
241
|
-
- To use the database inserter, ActiveRecord and an appropriate database adapter are
|
240
|
+
requirements:
|
241
|
+
- - ! '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
244
|
+
requirements:
|
245
|
+
- To use the database inserter, ActiveRecord and an appropriate database adapter are
|
246
|
+
required.
|
242
247
|
rubyforge_project: r-l-a
|
243
|
-
rubygems_version: 1.
|
248
|
+
rubygems_version: 1.8.16
|
244
249
|
signing_key:
|
245
250
|
specification_version: 3
|
246
|
-
summary: A command line tool to analyze request logs for Apache, Rails, Merb, MySQL
|
247
|
-
|
251
|
+
summary: A command line tool to analyze request logs for Apache, Rails, Merb, MySQL
|
252
|
+
and other web application servers
|
253
|
+
test_files:
|
248
254
|
- spec/integration/command_line_usage_spec.rb
|
249
255
|
- spec/integration/mailer_spec.rb
|
250
256
|
- spec/integration/munin_plugins_rails_spec.rb
|