request-log-analyzer 1.12.11 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -13
- data/README.rdoc +1 -3
- data/lib/request_log_analyzer/aggregator/database_inserter.rb +1 -1
- data/lib/request_log_analyzer/file_format.rb +1 -1
- data/lib/request_log_analyzer/line_definition.rb +2 -2
- data/lib/request_log_analyzer/version.rb +1 -1
- data/lib/request_log_analyzer.rb +0 -1
- data/request-log-analyzer.gemspec +2 -0
- metadata +5 -6
- data/Gemfile.activerecord2 +0 -9
- data/lib/other/ordered_hash.rb +0 -167
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d13886d7138b18ba797c914464ef06cf638b14d
|
4
|
+
data.tar.gz: 1e9b4a62e67715bcf782a8c5f30fa1740ce93578
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 910de9082b59c474b65fb4a618280e99e143194fbc2e0689fdca1eebdbc4beece89572924a8bf148a8ecf9d6f455a4fc745ad6fa1f8a43447b4a09cb7f78838e
|
7
|
+
data.tar.gz: bfa3b1e2e4cef2e005348faf503541aafbf0ce1e0e522a5b6ff192c369dfb032553cba3f0ced93808fb69c044b43fa3723d0d6491b41d31527034babf1b70116
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -4,17 +4,14 @@ before_script:
|
|
4
4
|
- psql -c 'create database rla_test;' -U postgres
|
5
5
|
script: bundle exec rake
|
6
6
|
rvm:
|
7
|
-
- 1.8.7
|
8
7
|
- 1.9.3
|
9
8
|
- 2.0.0
|
9
|
+
- 2.1.1
|
10
10
|
- ruby-head
|
11
|
-
- ree
|
12
|
-
- jruby-18mode
|
13
11
|
- jruby-19mode
|
14
12
|
- jruby-head
|
15
13
|
- rbx
|
16
14
|
gemfile:
|
17
|
-
- Gemfile.activerecord2
|
18
15
|
- Gemfile.activerecord3
|
19
16
|
- Gemfile.activerecord4
|
20
17
|
matrix:
|
@@ -22,15 +19,6 @@ matrix:
|
|
22
19
|
- rvm: jruby-head
|
23
20
|
- rvm: ruby-head
|
24
21
|
- rvm: rbx
|
25
|
-
exclude:
|
26
|
-
- gemfile: Gemfile.activerecord4
|
27
|
-
rvm: 1.8.7
|
28
|
-
- gemfile: Gemfile.activerecord4
|
29
|
-
rvm: ree
|
30
|
-
- gemfile: Gemfile.activerecord4
|
31
|
-
rvm: jruby-18mode
|
32
|
-
- gemfile: Gemfile.activerecord4
|
33
|
-
rvm: rbx-18mode
|
34
22
|
notifications:
|
35
23
|
email:
|
36
24
|
- info@railsdoctors.com
|
data/README.rdoc
CHANGED
@@ -7,7 +7,7 @@ This is a simple command line tool to analyze request log files in various forma
|
|
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://github.com/wvanbergen/request-log-analyzer/wiki/sample-output)
|
8
8
|
* Low memory footprint and reasonably fast, so it is safe to run on a production server.
|
9
9
|
* MIT licensed
|
10
|
-
* Runs on all rubies {<img src="https://secure.travis-ci.org/wvanbergen/request-log-analyzer.png" />}[http://travis-ci.org/wvanbergen/request-log-analyzer]
|
10
|
+
* Runs on all MRI 1.9+ compatible rubies {<img src="https://secure.travis-ci.org/wvanbergen/request-log-analyzer.png" />}[http://travis-ci.org/wvanbergen/request-log-analyzer]
|
11
11
|
|
12
12
|
See the project wiki at http://github.com/wvanbergen/request-log-analyzer/wiki for documentation and additional information.
|
13
13
|
|
@@ -30,8 +30,6 @@ For more details, other file formats, and available command line options, see th
|
|
30
30
|
$ time ./bin/request-log-analyzer 40MBRailsFile.log
|
31
31
|
|
32
32
|
ruby-1.9.2-p180 15.19s user 0.95s system 99% cpu 16.143 total
|
33
|
-
ree-1.8.7-2011.03 22.81s user 1.28s system 92% cpu 25.938 total
|
34
|
-
ruby-1.8.7-p334 25.21s user 1.02s system 99% cpu 26.238 total
|
35
33
|
jruby-1.5.3 32.64s user 4.84s system 99% cpu 37.629 total
|
36
34
|
rbx-2.0.0pre 39.62s user 2.24s system 104% cpu 40.098 total
|
37
35
|
macruby 75.00s user 20.10s system 110% cpu 1:26.13 total
|
@@ -39,7 +39,7 @@ module RequestLogAnalyzer::Aggregator
|
|
39
39
|
|
40
40
|
# Fix encoding patch for 1.9.2
|
41
41
|
attributes.each do |k,v|
|
42
|
-
attributes[k] = v.force_encoding("UTF-8") if v.is_a?(String)
|
42
|
+
attributes[k] = v.force_encoding("UTF-8") if v.is_a?(String)
|
43
43
|
end
|
44
44
|
|
45
45
|
@request_object.send("#{line[:line_type]}_lines").build(attributes)
|
@@ -248,7 +248,7 @@ module RequestLogAnalyzer::FileFormat
|
|
248
248
|
return self.new(line_definer.line_definitions, report_definer.trackers)
|
249
249
|
end
|
250
250
|
|
251
|
-
def initialize(line_definitions =
|
251
|
+
def initialize(line_definitions = {}, report_trackers = [])
|
252
252
|
@line_definitions, @report_trackers = line_definitions, report_trackers
|
253
253
|
end
|
254
254
|
|
@@ -10,7 +10,7 @@ module RequestLogAnalyzer
|
|
10
10
|
attr_accessor :line_definitions
|
11
11
|
|
12
12
|
def initialize
|
13
|
-
@line_definitions =
|
13
|
+
@line_definitions = {}
|
14
14
|
end
|
15
15
|
|
16
16
|
def initialize_copy(other)
|
@@ -67,7 +67,7 @@ module RequestLogAnalyzer
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def capture(name)
|
70
|
-
new_capture_hash =
|
70
|
+
new_capture_hash = {}
|
71
71
|
new_capture_hash[:name] = name
|
72
72
|
new_capture_hash[:type] = :string
|
73
73
|
captures << new_capture_hash
|
data/lib/request_log_analyzer.rb
CHANGED
@@ -29,6 +29,8 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.extra_rdoc_files = ['README.rdoc']
|
30
30
|
|
31
31
|
gem.requirements << "To use the database inserter, ActiveRecord and an appropriate database adapter are required."
|
32
|
+
gem.required_ruby_version = '>= 1.9.3'
|
33
|
+
|
32
34
|
gem.add_development_dependency('rake')
|
33
35
|
gem.add_development_dependency('rspec', '~> 2.14')
|
34
36
|
gem.add_development_dependency('activerecord')
|
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.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- .travis.yml
|
119
119
|
- DESIGN.rdoc
|
120
120
|
- Gemfile
|
121
|
-
- Gemfile.activerecord2
|
122
121
|
- Gemfile.activerecord3
|
123
122
|
- Gemfile.activerecord4
|
124
123
|
- LICENSE
|
@@ -130,7 +129,6 @@ files:
|
|
130
129
|
- lib/cli/database_console_init.rb
|
131
130
|
- lib/cli/progressbar.rb
|
132
131
|
- lib/cli/tools.rb
|
133
|
-
- lib/other/ordered_hash.rb
|
134
132
|
- lib/request_log_analyzer.rb
|
135
133
|
- lib/request_log_analyzer/aggregator.rb
|
136
134
|
- lib/request_log_analyzer/aggregator/database_inserter.rb
|
@@ -283,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
283
281
|
requirements:
|
284
282
|
- - '>='
|
285
283
|
- !ruby/object:Gem::Version
|
286
|
-
version:
|
284
|
+
version: 1.9.3
|
287
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
288
286
|
requirements:
|
289
287
|
- - '>='
|
@@ -293,7 +291,7 @@ requirements:
|
|
293
291
|
- To use the database inserter, ActiveRecord and an appropriate database adapter are
|
294
292
|
required.
|
295
293
|
rubyforge_project: r-l-a
|
296
|
-
rubygems_version: 2.
|
294
|
+
rubygems_version: 2.0.3
|
297
295
|
signing_key:
|
298
296
|
specification_version: 4
|
299
297
|
summary: A command line tool to analyze request logs for Apache, Rails, Merb, MySQL
|
@@ -380,3 +378,4 @@ test_files:
|
|
380
378
|
- spec/unit/tracker/timespan_tracker_spec.rb
|
381
379
|
- spec/unit/tracker/tracker_api_spec.rb
|
382
380
|
- spec/unit/tracker/traffic_tracker_spec.rb
|
381
|
+
has_rdoc:
|
data/Gemfile.activerecord2
DELETED
data/lib/other/ordered_hash.rb
DELETED
@@ -1,167 +0,0 @@
|
|
1
|
-
if RUBY_VERSION.to_f <= 1.8
|
2
|
-
|
3
|
-
# Simplified version copied from Activesupport::OrderedHash
|
4
|
-
class OrderedHash < ::Hash #:nodoc:
|
5
|
-
# In MRI the Hash class is core and written in C. In particular, methods are
|
6
|
-
# programmed with explicit C function calls and polymorphism is not honored.
|
7
|
-
#
|
8
|
-
# For example, []= is crucial in this implementation to maintain the @keys
|
9
|
-
# array but hash.c invokes rb_hash_aset() originally. This prevents method
|
10
|
-
# reuse through inheritance and forces us to reimplement stuff.
|
11
|
-
#
|
12
|
-
# For instance, we cannot use the inherited #merge! because albeit the algorithm
|
13
|
-
# itself would work, our []= is not being called at all by the C code.
|
14
|
-
|
15
|
-
def initialize(*args, &block)
|
16
|
-
super
|
17
|
-
@keys = []
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.[](*args)
|
21
|
-
ordered_hash = new
|
22
|
-
|
23
|
-
if (args.length == 1 && args.first.is_a?(Array))
|
24
|
-
args.first.each do |key_value_pair|
|
25
|
-
next unless (key_value_pair.is_a?(Array))
|
26
|
-
ordered_hash[key_value_pair[0]] = key_value_pair[1]
|
27
|
-
end
|
28
|
-
|
29
|
-
return ordered_hash
|
30
|
-
end
|
31
|
-
|
32
|
-
unless (args.size % 2 == 0)
|
33
|
-
raise ArgumentError.new("odd number of arguments for Hash")
|
34
|
-
end
|
35
|
-
|
36
|
-
args.each_with_index do |val, ind|
|
37
|
-
next if (ind % 2 != 0)
|
38
|
-
ordered_hash[val] = args[ind + 1]
|
39
|
-
end
|
40
|
-
|
41
|
-
ordered_hash
|
42
|
-
end
|
43
|
-
|
44
|
-
def initialize_copy(other)
|
45
|
-
super
|
46
|
-
# make a deep copy of keys
|
47
|
-
@keys = other.keys
|
48
|
-
end
|
49
|
-
|
50
|
-
def []=(key, value)
|
51
|
-
@keys << key unless has_key?(key)
|
52
|
-
super
|
53
|
-
end
|
54
|
-
|
55
|
-
def delete(key)
|
56
|
-
if has_key? key
|
57
|
-
index = @keys.index(key)
|
58
|
-
@keys.delete_at index
|
59
|
-
end
|
60
|
-
super
|
61
|
-
end
|
62
|
-
|
63
|
-
def delete_if
|
64
|
-
super
|
65
|
-
sync_keys!
|
66
|
-
self
|
67
|
-
end
|
68
|
-
|
69
|
-
def reject!
|
70
|
-
super
|
71
|
-
sync_keys!
|
72
|
-
self
|
73
|
-
end
|
74
|
-
|
75
|
-
def reject(&block)
|
76
|
-
dup.reject!(&block)
|
77
|
-
end
|
78
|
-
|
79
|
-
def keys
|
80
|
-
@keys.dup
|
81
|
-
end
|
82
|
-
|
83
|
-
def values
|
84
|
-
@keys.collect { |key| self[key] }
|
85
|
-
end
|
86
|
-
|
87
|
-
def to_hash
|
88
|
-
self
|
89
|
-
end
|
90
|
-
|
91
|
-
def to_a
|
92
|
-
@keys.map { |key| [ key, self[key] ] }
|
93
|
-
end
|
94
|
-
|
95
|
-
def each_key
|
96
|
-
return to_enum(:each_key) unless block_given?
|
97
|
-
@keys.each { |key| yield key }
|
98
|
-
self
|
99
|
-
end
|
100
|
-
|
101
|
-
def each_value
|
102
|
-
return to_enum(:each_value) unless block_given?
|
103
|
-
@keys.each { |key| yield self[key]}
|
104
|
-
self
|
105
|
-
end
|
106
|
-
|
107
|
-
def each
|
108
|
-
return to_enum(:each) unless block_given?
|
109
|
-
@keys.each {|key| yield [key, self[key]]}
|
110
|
-
self
|
111
|
-
end
|
112
|
-
|
113
|
-
alias_method :each_pair, :each
|
114
|
-
|
115
|
-
alias_method :select, :find_all
|
116
|
-
|
117
|
-
def clear
|
118
|
-
super
|
119
|
-
@keys.clear
|
120
|
-
self
|
121
|
-
end
|
122
|
-
|
123
|
-
def shift
|
124
|
-
k = @keys.first
|
125
|
-
v = delete(k)
|
126
|
-
[k, v]
|
127
|
-
end
|
128
|
-
|
129
|
-
def merge!(other_hash)
|
130
|
-
if block_given?
|
131
|
-
other_hash.each { |k, v| self[k] = key?(k) ? yield(k, self[k], v) : v }
|
132
|
-
else
|
133
|
-
other_hash.each { |k, v| self[k] = v }
|
134
|
-
end
|
135
|
-
self
|
136
|
-
end
|
137
|
-
|
138
|
-
alias_method :update, :merge!
|
139
|
-
|
140
|
-
def merge(other_hash, &block)
|
141
|
-
dup.merge!(other_hash, &block)
|
142
|
-
end
|
143
|
-
|
144
|
-
# When replacing with another hash, the initial order of our keys must come from the other hash -ordered or not.
|
145
|
-
def replace(other)
|
146
|
-
super
|
147
|
-
@keys = other.keys
|
148
|
-
self
|
149
|
-
end
|
150
|
-
|
151
|
-
def invert
|
152
|
-
OrderedHash[self.to_a.map!{|key_value_pair| key_value_pair.reverse}]
|
153
|
-
end
|
154
|
-
|
155
|
-
def inspect
|
156
|
-
"#<OrderedHash #{super}>"
|
157
|
-
end
|
158
|
-
|
159
|
-
private
|
160
|
-
def sync_keys!
|
161
|
-
@keys.delete_if {|k| !has_key?(k)}
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
else
|
166
|
-
::OrderedHash = ::Hash
|
167
|
-
end
|