request-log-analyzer 1.0.4 → 1.1.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.
- data/DESIGN +10 -0
- data/README.rdoc +3 -0
- data/bin/request-log-analyzer +3 -1
- data/lib/cli/progressbar.rb +182 -188
- data/lib/request_log_analyzer/aggregator/base.rb +1 -1
- data/lib/request_log_analyzer/aggregator/database.rb +4 -4
- data/lib/request_log_analyzer/aggregator/echo.rb +3 -5
- data/lib/request_log_analyzer/aggregator/summarizer.rb +26 -21
- data/lib/request_log_analyzer/controller.rb +18 -11
- data/lib/request_log_analyzer/filter/base.rb +3 -0
- data/lib/request_log_analyzer/filter/field.rb +5 -0
- data/lib/request_log_analyzer/filter/timespan.rb +8 -1
- data/lib/request_log_analyzer/output/fixed_width.rb +158 -0
- data/lib/request_log_analyzer/output/html.rb +80 -0
- data/lib/request_log_analyzer/output.rb +39 -0
- data/lib/request_log_analyzer/tracker/base.rb +1 -1
- data/lib/request_log_analyzer/tracker/category.rb +12 -21
- data/lib/request_log_analyzer/tracker/duration.rb +18 -23
- data/lib/request_log_analyzer/tracker/hourly_spread.rb +12 -22
- data/lib/request_log_analyzer/tracker/timespan.rb +10 -10
- data/lib/request_log_analyzer.rb +1 -1
- data/spec/controller_spec.rb +6 -2
- data/tasks/github-gem.rake +41 -7
- metadata +6 -3
- data/lib/cli/bashcolorizer.rb +0 -60
data/tasks/github-gem.rake
CHANGED
@@ -29,17 +29,24 @@ module Rake
|
|
29
29
|
desc "Releases a new version of #{@name}"
|
30
30
|
task(:build => [:manifest]) { build_task }
|
31
31
|
|
32
|
+
|
33
|
+
release_dependencies = [:check_clean_master_branch, :version, :build, :create_tag]
|
34
|
+
release_dependencies.push 'doc:publish' if has_rdoc?
|
35
|
+
release_dependencies.unshift 'test' if has_tests?
|
36
|
+
release_dependencies.unshift 'spec' if has_specs?
|
37
|
+
|
32
38
|
desc "Releases a new version of #{@name}"
|
33
|
-
task(:release =>
|
39
|
+
task(:release => release_dependencies) { release_task }
|
34
40
|
|
35
41
|
# helper task for releasing
|
36
42
|
task(:check_clean_master_branch) { verify_clean_status('master') }
|
37
43
|
task(:check_version) { verify_version(ENV['VERSION'] || @specification.version) }
|
38
|
-
task(:version => [:check_version]) { set_gem_version! }
|
44
|
+
task(:version => [:check_version]) { set_gem_version! }
|
45
|
+
task(:create_tag) { create_version_tag! }
|
39
46
|
end
|
40
47
|
|
41
48
|
# Register RDoc tasks
|
42
|
-
if
|
49
|
+
if has_rdoc?
|
43
50
|
require 'rake/rdoctask'
|
44
51
|
|
45
52
|
namespace(:doc) do
|
@@ -51,11 +58,21 @@ module Rake
|
|
51
58
|
rdoc.rdoc_files.include(@specification.extra_rdoc_files)
|
52
59
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
60
|
end
|
61
|
+
|
62
|
+
desc "Publish RDoc files for #{@name} to Github"
|
63
|
+
task(:publish => :compile) do
|
64
|
+
sh 'git checkout gh-pages'
|
65
|
+
sh 'git pull origin gh-pages'
|
66
|
+
sh 'cp -rf doc/* .'
|
67
|
+
sh "git commit -am \"Publishing newest RDoc documentation for #{@name}\""
|
68
|
+
sh "git push origin gh-pages"
|
69
|
+
sh "git checkout master"
|
70
|
+
end
|
54
71
|
end
|
55
72
|
end
|
56
73
|
|
57
74
|
# Setup :spec task if RSpec files exist
|
58
|
-
if
|
75
|
+
if has_specs?
|
59
76
|
require 'spec/rake/spectask'
|
60
77
|
|
61
78
|
desc "Run all specs for #{@name}"
|
@@ -65,7 +82,7 @@ module Rake
|
|
65
82
|
end
|
66
83
|
|
67
84
|
# Setup :test task if unit test files exist
|
68
|
-
if
|
85
|
+
if has_tests?
|
69
86
|
require 'rake/testtask'
|
70
87
|
|
71
88
|
desc "Run all unit tests for #{@name}"
|
@@ -79,6 +96,18 @@ module Rake
|
|
79
96
|
|
80
97
|
protected
|
81
98
|
|
99
|
+
def has_rdoc?
|
100
|
+
@specification.has_rdoc
|
101
|
+
end
|
102
|
+
|
103
|
+
def has_specs?
|
104
|
+
Dir['spec/**/*_spec.rb'].any?
|
105
|
+
end
|
106
|
+
|
107
|
+
def has_tests?
|
108
|
+
Dir['test/**/*_test.rb'].any?
|
109
|
+
end
|
110
|
+
|
82
111
|
def reload_gemspec!
|
83
112
|
raise "No gemspec file found!" if gemspec_file.nil?
|
84
113
|
spec = File.read(gemspec_file)
|
@@ -201,13 +230,18 @@ module Rake
|
|
201
230
|
sh "gem uninstall #{name}"
|
202
231
|
end
|
203
232
|
|
204
|
-
def
|
233
|
+
def create_version_tag!
|
205
234
|
# commit the gemspec file
|
206
235
|
git_commit_file(gemspec_file, "Updated #{gemspec_file} for release of version #{@specification.version}") if git_modified?(gemspec_file)
|
207
236
|
|
208
237
|
# create tag and push changes
|
209
238
|
git_create_tag("#{@name}-#{@specification.version}", "Tagged version #{@specification.version}")
|
210
|
-
git_push('origin', 'master', [:tags])
|
239
|
+
git_push('origin', 'master', [:tags])
|
240
|
+
end
|
241
|
+
|
242
|
+
def release_task
|
243
|
+
puts
|
244
|
+
puts "Released #{@name} - version#{@specification.version}"
|
211
245
|
end
|
212
246
|
end
|
213
247
|
end
|
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.0
|
4
|
+
version: 1.1.0
|
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: 2009-01-
|
13
|
+
date: 2009-01-18 00:00:00 +01:00
|
14
14
|
default_executable: request-log-analyzer
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -32,7 +32,6 @@ files:
|
|
32
32
|
- bin/request-log-analyzer
|
33
33
|
- lib
|
34
34
|
- lib/cli
|
35
|
-
- lib/cli/bashcolorizer.rb
|
36
35
|
- lib/cli/command_line_arguments.rb
|
37
36
|
- lib/cli/progressbar.rb
|
38
37
|
- lib/request_log_analyzer
|
@@ -56,6 +55,10 @@ files:
|
|
56
55
|
- lib/request_log_analyzer/line_definition.rb
|
57
56
|
- lib/request_log_analyzer/log_parser.rb
|
58
57
|
- lib/request_log_analyzer/log_processor.rb
|
58
|
+
- lib/request_log_analyzer/output
|
59
|
+
- lib/request_log_analyzer/output.rb
|
60
|
+
- lib/request_log_analyzer/output/fixed_width.rb
|
61
|
+
- lib/request_log_analyzer/output/html.rb
|
59
62
|
- lib/request_log_analyzer/request.rb
|
60
63
|
- lib/request_log_analyzer/source
|
61
64
|
- lib/request_log_analyzer/source/base.rb
|
data/lib/cli/bashcolorizer.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
# Colorize a text output with the given color if.
|
2
|
-
# <tt>text</tt> The text to colorize.
|
3
|
-
# <tt>color_code</tt> The color code string to set
|
4
|
-
# <tt>color</tt> Does not color if false. Defaults to false
|
5
|
-
def colorize(text, color_code, color = false)
|
6
|
-
color ? "#{color_code}#{text}\e[0m" : text
|
7
|
-
end
|
8
|
-
|
9
|
-
# Draw a red line of text
|
10
|
-
def red(text, color = false)
|
11
|
-
colorize(text, "\e[31m", color)
|
12
|
-
end
|
13
|
-
|
14
|
-
# Draw a Green line of text
|
15
|
-
def green(text, color = false)
|
16
|
-
colorize(text, "\e[32m", color)
|
17
|
-
end
|
18
|
-
|
19
|
-
# Draw a Yellow line of text
|
20
|
-
def yellow(text, color = false)
|
21
|
-
colorize(text, "\e[33m", color)
|
22
|
-
end
|
23
|
-
|
24
|
-
# Draw a Yellow line of text
|
25
|
-
def blue(text, color = false)
|
26
|
-
colorize(text, "\e[34m", color)
|
27
|
-
end
|
28
|
-
|
29
|
-
def white(text, color = false)
|
30
|
-
colorize(text, "\e[37m", color)
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
#STYLE = {
|
35
|
-
# :default => “33[0m”,
|
36
|
-
# # styles
|
37
|
-
# :bold => “33[1m”,
|
38
|
-
# :underline => “33[4m”,
|
39
|
-
# :blink => “33[5m”,
|
40
|
-
# :reverse => “33[7m”,
|
41
|
-
# :concealed => “33[8m”,
|
42
|
-
# # font colors
|
43
|
-
# :black => “33[30m”,
|
44
|
-
# :red => “33[31m”,
|
45
|
-
# :green => “33[32m”,
|
46
|
-
# :yellow => “33[33m”,
|
47
|
-
# :blue => “33[34m”,
|
48
|
-
# :magenta => “33[35m”,
|
49
|
-
# :cyan => “33[36m”,
|
50
|
-
# :white => “33[37m”,
|
51
|
-
# # background colors
|
52
|
-
# :on_black => “33[40m”,
|
53
|
-
# :on_red => “33[41m”,
|
54
|
-
# :on_green => “33[42m”,
|
55
|
-
# :on_yellow => “33[43m”,
|
56
|
-
# :on_blue => “33[44m”,
|
57
|
-
# :on_magenta => “33[45m”,
|
58
|
-
# :on_cyan => “33[46m”,
|
59
|
-
# :on_white => “33[47m” }
|
60
|
-
#
|