eye 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -17
- data/bin/eye +5 -0
- data/examples/notify.eye +18 -0
- data/examples/process_thin.rb +29 -0
- data/examples/sidekiq.eye +5 -1
- data/examples/test.eye +24 -17
- data/examples/thin-farm.eye +29 -0
- data/examples/unicorn.eye +2 -0
- data/eye.gemspec +1 -1
- data/lib/eye.rb +1 -1
- data/lib/eye/checker.rb +3 -5
- data/lib/eye/checker/http.rb +1 -2
- data/lib/eye/checker/socket.rb +2 -2
- data/lib/eye/controller/commands.rb +2 -0
- data/lib/eye/controller/send_command.rb +8 -2
- data/lib/eye/dsl.rb +1 -0
- data/lib/eye/dsl/opts.rb +36 -2
- data/lib/eye/dsl/pure_opts.rb +17 -39
- data/lib/eye/{checker → dsl}/validation.rb +15 -5
- data/lib/eye/group.rb +13 -4
- data/lib/eye/group/chain.rb +11 -0
- data/lib/eye/notify.rb +1 -1
- data/lib/eye/notify/mail.rb +1 -1
- data/lib/eye/process/child.rb +0 -2
- data/lib/eye/process/commands.rb +11 -14
- data/lib/eye/process/monitor.rb +10 -16
- data/lib/eye/process/scheduler.rb +8 -3
- data/lib/eye/process/states.rb +1 -2
- data/lib/eye/process/system.rb +38 -7
- data/lib/eye/process/watchers.rb +3 -3
- data/lib/eye/settings.rb +1 -1
- data/lib/eye/system.rb +33 -16
- data/lib/eye/trigger.rb +1 -1
- data/lib/eye/utils/celluloid_chain.rb +2 -0
- data/spec/checker/cpu_spec.rb +1 -1
- data/spec/checker/http_spec.rb +2 -2
- data/spec/checker/memory_spec.rb +2 -2
- data/spec/checker_spec.rb +1 -1
- data/spec/controller/controller_spec.rb +6 -0
- data/spec/controller/find_objects_spec.rb +6 -0
- data/spec/controller/intergration_spec.rb +24 -0
- data/spec/dsl/checks_spec.rb +2 -2
- data/spec/dsl/notify_spec.rb +12 -3
- data/spec/dsl/with_server_spec.rb +26 -2
- data/spec/process/checks/child_checks_spec.rb +1 -1
- data/spec/process/checks/memory_spec.rb +14 -0
- data/spec/process/scheduler_spec.rb +8 -0
- data/spec/process/system_spec.rb +27 -4
- data/spec/spec_helper.rb +3 -1
- data/spec/system_spec.rb +12 -5
- data/spec/utils/celluloid_chain_spec.rb +8 -0
- metadata +8 -5
data/spec/system_spec.rb
CHANGED
@@ -9,6 +9,13 @@ describe "Eye::System" do
|
|
9
9
|
Eye::System.pid_alive?(nil).should == false
|
10
10
|
end
|
11
11
|
|
12
|
+
it "check_pid_alive" do
|
13
|
+
Eye::System.check_pid_alive($$).should == {:result => true}
|
14
|
+
Eye::System.check_pid_alive(123456)[:error].class.should == Errno::ESRCH
|
15
|
+
Eye::System.check_pid_alive(-122)[:error].class.should == Errno::ESRCH
|
16
|
+
Eye::System.check_pid_alive(nil).should == {:result => false}
|
17
|
+
end
|
18
|
+
|
12
19
|
it "ps_aux" do
|
13
20
|
h = Eye::System.ps_aux
|
14
21
|
h.size.should > 10
|
@@ -86,13 +93,13 @@ describe "Eye::System" do
|
|
86
93
|
|
87
94
|
describe "send signal" do
|
88
95
|
it "send_signal to spec" do
|
89
|
-
Eye::System.send_signal($$, 0)[:
|
96
|
+
Eye::System.send_signal($$, 0)[:result].should == :ok
|
90
97
|
end
|
91
98
|
|
92
99
|
it "send_signal to unexisted process" do
|
93
100
|
res = Eye::System.send_signal(-12234)
|
94
|
-
res[:status].should ==
|
95
|
-
res[:
|
101
|
+
res[:status].should == nil
|
102
|
+
res[:error].message.should include("No such process")
|
96
103
|
end
|
97
104
|
|
98
105
|
it "send_signal to daemon" do
|
@@ -101,7 +108,7 @@ describe "Eye::System" do
|
|
101
108
|
# process should be alive
|
102
109
|
Eye::System.pid_alive?(@pid).should == true
|
103
110
|
|
104
|
-
Eye::System.send_signal(@pid, :term)[:
|
111
|
+
Eye::System.send_signal(@pid, :term)[:result].should == :ok
|
105
112
|
sleep 0.2
|
106
113
|
|
107
114
|
Eye::System.pid_alive?(@pid).should == false
|
@@ -113,7 +120,7 @@ describe "Eye::System" do
|
|
113
120
|
|
114
121
|
sleep 4
|
115
122
|
|
116
|
-
Eye::System.send_signal(@pid, :usr1)[:
|
123
|
+
Eye::System.send_signal(@pid, :usr1)[:result].should == :ok
|
117
124
|
|
118
125
|
sleep 0.5
|
119
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Makarchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - '>='
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 1.0.3
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - '>='
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 1.0.3
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: sinatra
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -251,6 +251,8 @@ files:
|
|
251
251
|
- Rakefile
|
252
252
|
- bin/eye
|
253
253
|
- bin/loader_eye
|
254
|
+
- examples/notify.eye
|
255
|
+
- examples/process_thin.rb
|
254
256
|
- examples/processes/em.rb
|
255
257
|
- examples/processes/forking.rb
|
256
258
|
- examples/processes/sample.rb
|
@@ -259,6 +261,7 @@ files:
|
|
259
261
|
- examples/rbenv.eye
|
260
262
|
- examples/sidekiq.eye
|
261
263
|
- examples/test.eye
|
264
|
+
- examples/thin-farm.eye
|
262
265
|
- examples/unicorn.eye
|
263
266
|
- eye.gemspec
|
264
267
|
- lib/eye.rb
|
@@ -270,7 +273,6 @@ files:
|
|
270
273
|
- lib/eye/checker/http.rb
|
271
274
|
- lib/eye/checker/memory.rb
|
272
275
|
- lib/eye/checker/socket.rb
|
273
|
-
- lib/eye/checker/validation.rb
|
274
276
|
- lib/eye/child_process.rb
|
275
277
|
- lib/eye/client.rb
|
276
278
|
- lib/eye/control.rb
|
@@ -292,6 +294,7 @@ files:
|
|
292
294
|
- lib/eye/dsl/process_opts.rb
|
293
295
|
- lib/eye/dsl/pure_opts.rb
|
294
296
|
- lib/eye/dsl/validate.rb
|
297
|
+
- lib/eye/dsl/validation.rb
|
295
298
|
- lib/eye/group.rb
|
296
299
|
- lib/eye/group/chain.rb
|
297
300
|
- lib/eye/io/unix_server.rb
|