haproxy2rpm 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ pkg/*
5
5
  log/*
6
6
  newrelic.yml
7
7
  .rvmrc
8
+ *.rbc
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - 1.8.7
5
+ - ree
6
+ - rbx-2.0
7
+ - jruby
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v 0.0.9
4
+
5
+ * Support syslog message format (Knut Nesheim)
6
+
3
7
  ## v 0.0.8
4
8
 
5
9
  * config file similar to unicorn.rb
data/README.md CHANGED
@@ -36,12 +36,46 @@ Check the examples folder
36
36
  * Histogram
37
37
  * Web transactions
38
38
 
39
+ ## Supported Ruby versions
40
+
41
+ Tested in production
42
+
43
+ * mri-1.9.2-p180
44
+ * ree-1.8.7-2011.03
45
+ * mri-1.8.7-p33
46
+
47
+ Passing manual integration test with test logs
48
+
49
+ * mri-1.9.2-p180
50
+ * ree-1.8.7-2011.03
51
+ * mri-1.8.7-p33
52
+ * jruby 1.6.2
53
+
54
+ rbx-head fails to write to the local db file:
55
+
56
+ Error serializing data to disk: #<TypeError: incompatible marshal file format (can't be read)format version 4.8 required
57
+
58
+
59
+ Passing unit tests
60
+
61
+ * mri-1.9.2-p180
62
+ * ree-1.8.7-2011.03
63
+ * mri-1.8.7-p33
64
+ * rbx-head
65
+ * jruby 1.6.2
66
+
67
+ ## Performance
68
+
69
+ No performance testing done so fare. Judging by the results of [jordansissel](https://github.com/jordansissel/experiments/tree/master/ruby/eventmachine-speed), MRI 1.9.2 and jRuby should be the fastest.
70
+
39
71
  ## Known issues
40
72
 
41
73
  * Daemonize is broken. Does not work nicely with new relic agent
74
+ * Does not work with Rubinius
42
75
 
43
76
  ## Roadmap
44
77
 
45
78
  * Working daemonized mode
46
- * remove haproxy dependency and make it a more generic rpm recorder that
47
- works over syslog and log files. This would allow to send custom messages to rpm by just sending log lines through syslog. The haproxy part would be more of a strategy. That means we need to make it easyly extendible without forking or creating a new gem
79
+ * remove haproxy dependency and make it a more generic rpm recorder. Maybe change the name to log2rpm or log4rpm
80
+ * Automated benchmarks to see how fast it performs and what Ruby version
81
+ might be best suited for a use case
data/Rakefile CHANGED
@@ -4,6 +4,11 @@ require 'rake/testtask'
4
4
 
5
5
  task :default => ['test:units']
6
6
 
7
+ def rubies
8
+ require 'yaml'
9
+ rubies = YAML.load_file('.travis.yml')['rvm']
10
+ end
11
+
7
12
  namespace :test do
8
13
  Rake::TestTask.new(:units) do |t|
9
14
  t.libs << "test"
@@ -12,6 +17,20 @@ namespace :test do
12
17
  t.verbose = true
13
18
  end
14
19
 
20
+ desc 'run bundle install for all rubies'
21
+ task :prepare_rubies do
22
+ rubies.each do |ruby_version|
23
+ puts `rvm use #{ruby_version} && gem install bundler && bundle`
24
+ end
25
+ end
26
+
27
+ desc 'run test suite with all ruby versions'
28
+ task :multi_ruby do
29
+ rubies.each do |ruby_version|
30
+ puts `rvm use #{ruby_version} && bundle exec rake`
31
+ end
32
+ end
33
+
15
34
  desc 'send udp log lines for testing purposes'
16
35
  task :send_udp_log_lines do
17
36
  port = ENV['port'] || 3333
@@ -3,7 +3,12 @@ module Haproxy2Rpm
3
3
 
4
4
  def initialize(line)
5
5
  @line = line
6
- @parts = line.split("\s")
6
+
7
+ if @line.match "haproxy"
8
+ @parts = @line.split("haproxy")[1].split("\s")
9
+ else
10
+ @parts = @line.split("\s")
11
+ end
7
12
  end
8
13
 
9
14
  def tq
@@ -25,7 +25,7 @@ module Haproxy2Rpm
25
25
  def process_and_send(line)
26
26
  message = message_parser.call(line)
27
27
  if(message)
28
- request_recorder.call(message_parser.call(line))
28
+ request_recorder.call(message)
29
29
  else
30
30
  Haproxy2Rpm.logger.warn "Parser returned an empty message from line #{line}"
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module Haproxy2Rpm
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/test/rpm_test.rb CHANGED
@@ -94,4 +94,4 @@ class RpmTest < Test::Unit::TestCase
94
94
  @instance.process_and_send('12')
95
95
  end
96
96
  end
97
- end
97
+ end
data/test/test_helper.rb CHANGED
@@ -31,6 +31,6 @@ def log_entry(options = {})
31
31
  }
32
32
  defaults.merge!(options)
33
33
  log_line = <<LOG_LINE
34
- haproxy[674]: 127.0.0.1:33319 [15/Oct/2003:08:31:57] relais-http Srv1 #{defaults[:tq]}/#{defaults[:tw]}/#{defaults[:tc]}/#{defaults[:tr]}/#{defaults[:tt]} #{defaults[:status_code]} 243 - - ---- 1/3/5 0/0 "#{defaults[:http_method]} #{defaults[:http_path]}#{defaults[:http_query] ? "?#{defaults[:http_query]}" : ''} HTTP/1.0"
34
+ Aug 1 15:28:03 ip-10-58-122-30.eu-west-1.compute.internal haproxy[674]: 127.0.0.1:33319 [15/Oct/2003:08:31:57] relais-http Srv1 #{defaults[:tq]}/#{defaults[:tw]}/#{defaults[:tc]}/#{defaults[:tr]}/#{defaults[:tt]} #{defaults[:status_code]} 243 - - ---- 1/3/5 0/0 "#{defaults[:http_method]} #{defaults[:http_path]}#{defaults[:http_query] ? "?#{defaults[:http_query]}" : ''} HTTP/1.0"
35
35
  LOG_LINE
36
36
  end
metadata CHANGED
@@ -1,106 +1,83 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: haproxy2rpm
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Patrick Huesler
14
9
  - Martin Rehfeld
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-07-18 00:00:00 +02:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2011-08-11 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: newrelic_rpm
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70309583696800 !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
34
23
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: eventmachine-tail
38
24
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *70309583696800
26
+ - !ruby/object:Gem::Dependency
27
+ name: eventmachine-tail
28
+ requirement: &70309583696140 !ruby/object:Gem::Requirement
40
29
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
48
34
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: rake
52
35
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *70309583696140
37
+ - !ruby/object:Gem::Dependency
38
+ name: rake
39
+ requirement: &70309583695480 !ruby/object:Gem::Requirement
54
40
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
62
45
  type: :development
63
- version_requirements: *id003
64
- - !ruby/object:Gem::Dependency
65
- name: shoulda-context
66
46
  prerelease: false
67
- requirement: &id004 !ruby/object:Gem::Requirement
47
+ version_requirements: *70309583695480
48
+ - !ruby/object:Gem::Dependency
49
+ name: shoulda-context
50
+ requirement: &70309583694680 !ruby/object:Gem::Requirement
68
51
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
76
56
  type: :development
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: mocha
80
57
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
58
+ version_requirements: *70309583694680
59
+ - !ruby/object:Gem::Dependency
60
+ name: mocha
61
+ requirement: &70309583694100 !ruby/object:Gem::Requirement
82
62
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
90
67
  type: :development
91
- version_requirements: *id005
68
+ prerelease: false
69
+ version_requirements: *70309583694100
92
70
  description: Sending haproxy logs to new relic rpm
93
- email:
71
+ email:
94
72
  - patrick.huesler@wooga.com
95
73
  - martin.rehfeld@wooga.com
96
- executables:
74
+ executables:
97
75
  - haproxy2rpm
98
76
  extensions: []
99
-
100
77
  extra_rdoc_files: []
101
-
102
- files:
78
+ files:
103
79
  - .gitignore
80
+ - .travis.yml
104
81
  - CHANGELOG.md
105
82
  - Gemfile
106
83
  - README.md
@@ -122,41 +99,31 @@ files:
122
99
  - test/haproxy2pm_test.rb
123
100
  - test/rpm_test.rb
124
101
  - test/test_helper.rb
125
- has_rdoc: true
126
102
  homepage: https://github.com/wooga/haproxy2rpm
127
103
  licenses: []
128
-
129
104
  post_install_message:
130
105
  rdoc_options: []
131
-
132
- require_paths:
106
+ require_paths:
133
107
  - lib
134
- required_ruby_version: !ruby/object:Gem::Requirement
108
+ required_ruby_version: !ruby/object:Gem::Requirement
135
109
  none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- hash: 3
140
- segments:
141
- - 0
142
- version: "0"
143
- required_rubygems_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ! '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
144
115
  none: false
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: 3
149
- segments:
150
- - 0
151
- version: "0"
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
152
120
  requirements: []
153
-
154
121
  rubyforge_project:
155
- rubygems_version: 1.6.2
122
+ rubygems_version: 1.8.6
156
123
  signing_key:
157
124
  specification_version: 3
158
125
  summary: Sending haproxy logs to new relic rpm
159
- test_files:
126
+ test_files:
160
127
  - test/fixtures/config.rb
161
128
  - test/haproxy2pm_test.rb
162
129
  - test/rpm_test.rb