ganymed 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  collect do
2
- break if not File.readable?('/proc/stat')
2
+ next if not File.readable?('/proc/stat')
3
3
 
4
4
  File.open('/proc/stat') do | file|
5
5
  file.each do |line|
@@ -4,7 +4,7 @@ Struct.new("NetworkStat", :dev,
4
4
  :wbytes, :wpackets, :werrs, :wdrop, :wfifo, :wcolls, :wcarrier, :wcompressed)
5
5
 
6
6
  collect do
7
- break if not File.readable?('/proc/net/dev')
7
+ next if not File.readable?('/proc/net/dev')
8
8
 
9
9
  File.open('/proc/net/dev') do |file|
10
10
  file.each do |line|
@@ -1,5 +1,5 @@
1
1
  collect do
2
- break if not File.readable?('/proc/stat')
2
+ next if not File.readable?('/proc/stat')
3
3
  File.open('/proc/stat') do |file|
4
4
  file.each do |line|
5
5
  key, value = line.chomp.split
@@ -1,5 +1,5 @@
1
1
  collect do
2
- break if not File.readable?('/proc/stat')
2
+ next if not File.readable?('/proc/stat')
3
3
  File.open('/proc/stat') do |file|
4
4
  file.each do |line|
5
5
  next if not line =~ /^btime /
@@ -31,15 +31,6 @@ module Ganymed
31
31
  end
32
32
 
33
33
  def run
34
- if pid = Process.fork
35
- @supervisor = true
36
- Process.wait(pid)
37
- else
38
- child
39
- end
40
- end
41
-
42
- def child
43
34
  log.info("starting Ganymed reactor in #{Env.mode} mode")
44
35
 
45
36
  # configure eventmachine
@@ -57,23 +48,21 @@ module Ganymed
57
48
  end
58
49
 
59
50
  def before_starting
60
- unless @supervisor
61
- if config.profiling.perftools
62
- log.info("activating PerfTools CPU profiler")
63
- require 'perftools'
64
- PerfTools::CpuProfiler.start('profile')
65
- end
51
+ if config.profiling.perftools
52
+ log.info("activating PerfTools CPU profiler")
53
+ require 'perftools'
54
+ PerfTools::CpuProfiler.start('profile')
55
+ end
66
56
 
67
- if config.profiling.gcprofiler
68
- log.info("activating GC::Profiler")
69
- GC::Profiler.enable
70
- end
57
+ if config.profiling.gcprofiler
58
+ log.info("activating GC::Profiler")
59
+ GC::Profiler.enable
60
+ end
71
61
 
72
- if config.profiling.rubyprof
73
- require 'ruby-prof'
74
- log.info("activating RubyProf")
75
- RubyProf.start
76
- end
62
+ if config.profiling.rubyprof
63
+ require 'ruby-prof'
64
+ log.info("activating RubyProf")
65
+ RubyProf.start
77
66
  end
78
67
  end
79
68
 
@@ -85,23 +74,21 @@ module Ganymed
85
74
  end
86
75
 
87
76
  def after_stopping
88
- unless @supervisor
89
- if config.profiling.perftools
90
- PerfTools::CpuProfiler.stop
91
- `pprof.rb --svg profile > profile.svg`
92
- end
77
+ if config.profiling.perftools
78
+ PerfTools::CpuProfiler.stop
79
+ `pprof.rb --svg profile > profile.svg`
80
+ end
93
81
 
94
- if config.profiling.rubyprof
95
- result = RubyProf.stop
96
- result.eliminate_methods!([
97
- /Queue#pop/,
98
- /Queue#push/,
99
- /Mutex#synchronize/,
100
- /Mutex#sleep/,
101
- ])
102
- printer = RubyProf::MultiPrinter.new(result)
103
- printer.print(:path => "prof", :profile => "ganymed")
104
- end
82
+ if config.profiling.rubyprof
83
+ result = RubyProf.stop
84
+ result.eliminate_methods!([
85
+ /Queue#pop/,
86
+ /Queue#push/,
87
+ /Mutex#synchronize/,
88
+ /Mutex#sleep/,
89
+ ])
90
+ printer = RubyProf::MultiPrinter.new(result)
91
+ printer.print(:path => "prof", :profile => "ganymed")
105
92
  end
106
93
 
107
94
  log.info("done shutting down. exiting ...")
@@ -14,8 +14,8 @@ module Ganymed
14
14
  def connection
15
15
  @connection ||= ::Mongo::Connection.new(config.host,
16
16
  config.port,
17
- :pool_size => 5,
18
- :pool_timeout => 5)
17
+ :pool_size => config.pool_size,
18
+ :pool_timeout => config.pool_timeout)
19
19
  end
20
20
 
21
21
  def db
@@ -1,4 +1,4 @@
1
1
  module Ganymed
2
2
  # @private
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ganymed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &16400780 !ruby/object:Gem::Requirement
16
+ requirement: &7558920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16400780
24
+ version_requirements: *7558920
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: eventmachine
27
- requirement: &16399280 !ruby/object:Gem::Requirement
27
+ requirement: &7557220 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.12.10
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *16399280
35
+ version_requirements: *7557220
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ganymed-client
38
- requirement: &16397660 !ruby/object:Gem::Requirement
38
+ requirement: &7555900 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *16397660
46
+ version_requirements: *7555900
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: madvertise-ext
49
- requirement: &16396540 !ruby/object:Gem::Requirement
49
+ requirement: &7554720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.1.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *16396540
57
+ version_requirements: *7554720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: madvertise-logging
60
- requirement: &16395360 !ruby/object:Gem::Requirement
60
+ requirement: &7553740 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.3.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *16395360
68
+ version_requirements: *7553740
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mixlib-cli
71
- requirement: &16394880 !ruby/object:Gem::Requirement
71
+ requirement: &7553220 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *16394880
79
+ version_requirements: *7553220
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: RubyInline
82
- requirement: &16410420 !ruby/object:Gem::Requirement
82
+ requirement: &7567900 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *16410420
90
+ version_requirements: *7567900
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: servolux
93
- requirement: &16408420 !ruby/object:Gem::Requirement
93
+ requirement: &7566640 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *16408420
101
+ version_requirements: *7566640
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: msgpack
104
- requirement: &16406820 !ruby/object:Gem::Requirement
104
+ requirement: &7564920 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *16406820
112
+ version_requirements: *7564920
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: mongo
115
- requirement: &16405220 !ruby/object:Gem::Requirement
115
+ requirement: &7562960 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '1.6'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *16405220
123
+ version_requirements: *7562960
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: em-websocket
126
- requirement: &16403660 !ruby/object:Gem::Requirement
126
+ requirement: &7561620 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *16403660
134
+ version_requirements: *7561620
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: yajl-ruby
137
- requirement: &16402580 !ruby/object:Gem::Requirement
137
+ requirement: &7592340 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *16402580
145
+ version_requirements: *7592340
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: sys-filesystem
148
- requirement: &16433420 !ruby/object:Gem::Requirement
148
+ requirement: &7591700 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :runtime
155
155
  prerelease: false
156
- version_requirements: *16433420
156
+ version_requirements: *7591700
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: ohai
159
- requirement: &16432680 !ruby/object:Gem::Requirement
159
+ requirement: &7590960 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,7 +164,7 @@ dependencies:
164
164
  version: 0.6.12
165
165
  type: :runtime
166
166
  prerelease: false
167
- version_requirements: *16432680
167
+ version_requirements: *7590960
168
168
  description: Ganymed is an event collection daemon
169
169
  email:
170
170
  - bb@xnull.de
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  version: '0'
240
240
  segments:
241
241
  - 0
242
- hash: 4174202345634086766
242
+ hash: -4196854861267997123
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  none: false
245
245
  requirements:
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  segments:
250
250
  - 0
251
- hash: 4174202345634086766
251
+ hash: -4196854861267997123
252
252
  requirements: []
253
253
  rubyforge_project:
254
254
  rubygems_version: 1.8.17