request-log-analyzer 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/DESIGN +14 -0
  2. data/HACKING +7 -0
  3. data/LICENSE +20 -0
  4. data/README.textile +36 -0
  5. data/Rakefile +5 -0
  6. data/bin/request-log-analyzer +123 -0
  7. data/lib/cli/bashcolorizer.rb +60 -0
  8. data/lib/cli/command_line_arguments.rb +301 -0
  9. data/lib/cli/progressbar.rb +236 -0
  10. data/lib/request_log_analyzer.rb +14 -0
  11. data/lib/request_log_analyzer/aggregator/base.rb +45 -0
  12. data/lib/request_log_analyzer/aggregator/database.rb +148 -0
  13. data/lib/request_log_analyzer/aggregator/echo.rb +25 -0
  14. data/lib/request_log_analyzer/aggregator/summarizer.rb +116 -0
  15. data/lib/request_log_analyzer/controller.rb +201 -0
  16. data/lib/request_log_analyzer/file_format.rb +81 -0
  17. data/lib/request_log_analyzer/file_format/merb.rb +33 -0
  18. data/lib/request_log_analyzer/file_format/rails.rb +90 -0
  19. data/lib/request_log_analyzer/filter/base.rb +29 -0
  20. data/lib/request_log_analyzer/filter/field.rb +36 -0
  21. data/lib/request_log_analyzer/filter/timespan.rb +32 -0
  22. data/lib/request_log_analyzer/line_definition.rb +159 -0
  23. data/lib/request_log_analyzer/log_parser.rb +173 -0
  24. data/lib/request_log_analyzer/log_processor.rb +121 -0
  25. data/lib/request_log_analyzer/request.rb +95 -0
  26. data/lib/request_log_analyzer/source/base.rb +42 -0
  27. data/lib/request_log_analyzer/source/log_file.rb +170 -0
  28. data/lib/request_log_analyzer/tracker/base.rb +54 -0
  29. data/lib/request_log_analyzer/tracker/category.rb +71 -0
  30. data/lib/request_log_analyzer/tracker/duration.rb +81 -0
  31. data/lib/request_log_analyzer/tracker/hourly_spread.rb +80 -0
  32. data/lib/request_log_analyzer/tracker/timespan.rb +54 -0
  33. data/spec/controller_spec.rb +40 -0
  34. data/spec/database_inserter_spec.rb +101 -0
  35. data/spec/file_format_spec.rb +78 -0
  36. data/spec/file_formats/spec_format.rb +26 -0
  37. data/spec/filter_spec.rb +137 -0
  38. data/spec/fixtures/merb.log +84 -0
  39. data/spec/fixtures/multiple_files_1.log +5 -0
  40. data/spec/fixtures/multiple_files_2.log +2 -0
  41. data/spec/fixtures/rails_1x.log +59 -0
  42. data/spec/fixtures/rails_22.log +12 -0
  43. data/spec/fixtures/rails_22_cached.log +10 -0
  44. data/spec/fixtures/rails_unordered.log +24 -0
  45. data/spec/fixtures/syslog_1x.log +5 -0
  46. data/spec/fixtures/test_file_format.log +13 -0
  47. data/spec/fixtures/test_language_combined.log +14 -0
  48. data/spec/fixtures/test_order.log +16 -0
  49. data/spec/line_definition_spec.rb +124 -0
  50. data/spec/log_parser_spec.rb +68 -0
  51. data/spec/log_processor_spec.rb +57 -0
  52. data/spec/merb_format_spec.rb +38 -0
  53. data/spec/rails_format_spec.rb +76 -0
  54. data/spec/request_spec.rb +72 -0
  55. data/spec/spec_helper.rb +67 -0
  56. data/spec/summarizer_spec.rb +9 -0
  57. data/tasks/github-gem.rake +177 -0
  58. data/tasks/request_log_analyzer.rake +10 -0
  59. data/tasks/rspec.rake +6 -0
  60. metadata +135 -0
@@ -0,0 +1,10 @@
1
+ namespace :log do
2
+ desc "Analyze the Rails log file using the request-log-analyzer gem."
3
+ task :analyze => :environment do
4
+ puts "Analyzing the Rails log file using the request-log-analyzer gem."
5
+ puts "Environment: #{RAILS_ENV}"
6
+ puts "Logfile: #{Rails.configuration.log_path}"
7
+ puts ""
8
+ `request-log-analyzer #{Rails.configuration.log_path} -z`
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec/rake/spectask'
2
+
3
+ desc "Run all specs in spec directory (excluding plugin specs)"
4
+ Spec::Rake::SpecTask.new(:spec) do |t|
5
+ t.spec_files = FileList['spec/**/*_spec.rb']
6
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: request-log-analyzer
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Willem van Bergen
8
+ - Bart ten Brinke
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-01-13 00:00:00 +01:00
14
+ default_executable: request-log-analyzer
15
+ dependencies: []
16
+
17
+ description: Rails log analyzer's purpose is to find what actions are best candidates for optimization. This tool will parse all requests in the Rails logfile and aggregate the information. Once it is finished parsing the log file, it will show the requests that take op most server time using various metrics.
18
+ email: willem@vanbergen.org
19
+ executables:
20
+ - request-log-analyzer
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - DESIGN
27
+ - HACKING
28
+ - LICENSE
29
+ - README.textile
30
+ - Rakefile
31
+ - bin
32
+ - bin/request-log-analyzer
33
+ - lib
34
+ - lib/cli
35
+ - lib/cli/bashcolorizer.rb
36
+ - lib/cli/command_line_arguments.rb
37
+ - lib/cli/progressbar.rb
38
+ - lib/request_log_analyzer
39
+ - lib/request_log_analyzer.rb
40
+ - lib/request_log_analyzer/aggregator
41
+ - lib/request_log_analyzer/aggregator/base.rb
42
+ - lib/request_log_analyzer/aggregator/database.rb
43
+ - lib/request_log_analyzer/aggregator/echo.rb
44
+ - lib/request_log_analyzer/aggregator/summarizer.rb
45
+ - lib/request_log_analyzer/controller.rb
46
+ - lib/request_log_analyzer/file_format
47
+ - lib/request_log_analyzer/file_format.rb
48
+ - lib/request_log_analyzer/file_format/merb.rb
49
+ - lib/request_log_analyzer/file_format/rails.rb
50
+ - lib/request_log_analyzer/filter
51
+ - lib/request_log_analyzer/filter/base.rb
52
+ - lib/request_log_analyzer/filter/field.rb
53
+ - lib/request_log_analyzer/filter/timespan.rb
54
+ - lib/request_log_analyzer/line_definition.rb
55
+ - lib/request_log_analyzer/log_parser.rb
56
+ - lib/request_log_analyzer/log_processor.rb
57
+ - lib/request_log_analyzer/request.rb
58
+ - lib/request_log_analyzer/source
59
+ - lib/request_log_analyzer/source/base.rb
60
+ - lib/request_log_analyzer/source/log_file.rb
61
+ - lib/request_log_analyzer/tracker
62
+ - lib/request_log_analyzer/tracker/base.rb
63
+ - lib/request_log_analyzer/tracker/category.rb
64
+ - lib/request_log_analyzer/tracker/duration.rb
65
+ - lib/request_log_analyzer/tracker/hourly_spread.rb
66
+ - lib/request_log_analyzer/tracker/timespan.rb
67
+ - spec
68
+ - spec/controller_spec.rb
69
+ - spec/database_inserter_spec.rb
70
+ - spec/file_format_spec.rb
71
+ - spec/file_formats
72
+ - spec/file_formats/spec_format.rb
73
+ - spec/filter_spec.rb
74
+ - spec/fixtures
75
+ - spec/fixtures/merb.log
76
+ - spec/fixtures/multiple_files_1.log
77
+ - spec/fixtures/multiple_files_2.log
78
+ - spec/fixtures/rails_1x.log
79
+ - spec/fixtures/rails_22.log
80
+ - spec/fixtures/rails_22_cached.log
81
+ - spec/fixtures/rails_unordered.log
82
+ - spec/fixtures/syslog_1x.log
83
+ - spec/fixtures/test_file_format.log
84
+ - spec/fixtures/test_language_combined.log
85
+ - spec/fixtures/test_order.log
86
+ - spec/line_definition_spec.rb
87
+ - spec/log_parser_spec.rb
88
+ - spec/log_processor_spec.rb
89
+ - spec/merb_format_spec.rb
90
+ - spec/rails_format_spec.rb
91
+ - spec/request_spec.rb
92
+ - spec/spec_helper.rb
93
+ - spec/summarizer_spec.rb
94
+ - tasks
95
+ - tasks/github-gem.rake
96
+ - tasks/request_log_analyzer.rake
97
+ - tasks/rspec.rake
98
+ has_rdoc: false
99
+ homepage: http://github.com/wvanbergen/request-log-analyzer/wikis
100
+ post_install_message:
101
+ rdoc_options: []
102
+
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: "0"
110
+ version:
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: "0"
116
+ version:
117
+ requirements: []
118
+
119
+ rubyforge_project: r-l-a
120
+ rubygems_version: 1.2.0
121
+ signing_key:
122
+ specification_version: 2
123
+ summary: A command line tool to analyze Rails logs
124
+ test_files:
125
+ - spec/controller_spec.rb
126
+ - spec/database_inserter_spec.rb
127
+ - spec/file_format_spec.rb
128
+ - spec/filter_spec.rb
129
+ - spec/line_definition_spec.rb
130
+ - spec/log_parser_spec.rb
131
+ - spec/log_processor_spec.rb
132
+ - spec/merb_format_spec.rb
133
+ - spec/rails_format_spec.rb
134
+ - spec/request_spec.rb
135
+ - spec/summarizer_spec.rb