eye 0.2.4 → 0.3
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.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/bin/eye +7 -0
- data/bin/loader_eye +7 -5
- data/examples/notify.eye +1 -1
- data/eye.gemspec +4 -4
- data/lib/eye.rb +1 -3
- data/lib/eye/controller.rb +4 -0
- data/lib/eye/controller/status.rb +1 -1
- data/lib/eye/dsl.rb +1 -1
- data/lib/eye/dsl/main.rb +0 -13
- data/lib/eye/dsl/opts.rb +4 -2
- data/lib/eye/loader.rb +2 -3
- data/lib/eye/notify.rb +3 -3
- data/lib/eye/process/monitor.rb +5 -3
- data/lib/eye/process/notify.rb +5 -5
- data/lib/eye/process/scheduler.rb +4 -4
- data/lib/eye/process/system.rb +3 -10
- data/lib/eye/process/trigger.rb +1 -1
- data/lib/eye/process/watchers.rb +1 -1
- data/lib/eye/server.rb +9 -8
- data/lib/eye/system.rb +2 -7
- data/lib/eye/system_resources.rb +3 -3
- data/lib/eye/utils/celluloid_chain.rb +2 -2
- metadata +7 -241
- data/lib/eye/io/unix_server.rb +0 -44
- data/lib/eye/io/unix_socket.rb +0 -39
- data/spec/checker/cpu_spec.rb +0 -58
- data/spec/checker/file_ctime_spec.rb +0 -34
- data/spec/checker/file_size_spec.rb +0 -107
- data/spec/checker/http_spec.rb +0 -114
- data/spec/checker/memory_spec.rb +0 -64
- data/spec/checker/socket_spec.rb +0 -116
- data/spec/checker_spec.rb +0 -187
- data/spec/child_process/child_process_spec.rb +0 -46
- data/spec/client_server_spec.rb +0 -33
- data/spec/controller/commands_spec.rb +0 -92
- data/spec/controller/controller_spec.rb +0 -157
- data/spec/controller/find_objects_spec.rb +0 -176
- data/spec/controller/group_spec.rb +0 -110
- data/spec/controller/intergration_spec.rb +0 -366
- data/spec/controller/load_spec.rb +0 -371
- data/spec/controller/races_spec.rb +0 -70
- data/spec/controller/stop_on_delete_spec.rb +0 -157
- data/spec/dsl/chain_spec.rb +0 -146
- data/spec/dsl/checks_spec.rb +0 -219
- data/spec/dsl/config_spec.rb +0 -44
- data/spec/dsl/dsl_spec.rb +0 -73
- data/spec/dsl/getter_spec.rb +0 -223
- data/spec/dsl/integration_spec.rb +0 -376
- data/spec/dsl/load_spec.rb +0 -52
- data/spec/dsl/notify_spec.rb +0 -114
- data/spec/dsl/process_spec.rb +0 -380
- data/spec/dsl/sub_procs_spec.rb +0 -93
- data/spec/dsl/with_server_spec.rb +0 -128
- data/spec/example/em.rb +0 -57
- data/spec/example/forking.rb +0 -20
- data/spec/example/sample.rb +0 -154
- data/spec/fixtures/dsl/0.rb +0 -8
- data/spec/fixtures/dsl/0a.rb +0 -8
- data/spec/fixtures/dsl/0c.rb +0 -8
- data/spec/fixtures/dsl/1.rb +0 -5
- data/spec/fixtures/dsl/bad.eye +0 -6
- data/spec/fixtures/dsl/configs/1.eye +0 -3
- data/spec/fixtures/dsl/configs/2.eye +0 -1
- data/spec/fixtures/dsl/configs/3.eye +0 -1
- data/spec/fixtures/dsl/configs/4.eye +0 -3
- data/spec/fixtures/dsl/empty.eye +0 -20
- data/spec/fixtures/dsl/include_test.eye +0 -5
- data/spec/fixtures/dsl/include_test/1.rb +0 -6
- data/spec/fixtures/dsl/include_test/ha.rb +0 -4
- data/spec/fixtures/dsl/include_test2.eye +0 -5
- data/spec/fixtures/dsl/integration.eye +0 -30
- data/spec/fixtures/dsl/integration2.eye +0 -32
- data/spec/fixtures/dsl/integration_locks.eye +0 -30
- data/spec/fixtures/dsl/integration_sor.eye +0 -32
- data/spec/fixtures/dsl/integration_sor2.eye +0 -27
- data/spec/fixtures/dsl/integration_sor3.eye +0 -32
- data/spec/fixtures/dsl/load.eye +0 -25
- data/spec/fixtures/dsl/load2.eye +0 -7
- data/spec/fixtures/dsl/load2_dup2.eye +0 -13
- data/spec/fixtures/dsl/load2_dup_pid.eye +0 -7
- data/spec/fixtures/dsl/load3.eye +0 -10
- data/spec/fixtures/dsl/load4.eye +0 -7
- data/spec/fixtures/dsl/load5.eye +0 -8
- data/spec/fixtures/dsl/load6.eye +0 -17
- data/spec/fixtures/dsl/load_dubls.eye +0 -36
- data/spec/fixtures/dsl/load_dup_ex_names.eye +0 -15
- data/spec/fixtures/dsl/load_error.eye +0 -5
- data/spec/fixtures/dsl/load_error_folder/load3.eye +0 -10
- data/spec/fixtures/dsl/load_error_folder/load4.eye +0 -7
- data/spec/fixtures/dsl/load_folder/load3.eye +0 -10
- data/spec/fixtures/dsl/load_folder/load4.eye +0 -7
- data/spec/fixtures/dsl/load_int.eye +0 -8
- data/spec/fixtures/dsl/load_int2.eye +0 -13
- data/spec/fixtures/dsl/load_logger.eye +0 -26
- data/spec/fixtures/dsl/load_logger2.eye +0 -3
- data/spec/fixtures/dsl/long_load.eye +0 -5
- data/spec/fixtures/dsl/subfolder1/proc1.rb +0 -3
- data/spec/fixtures/dsl/subfolder2.eye +0 -9
- data/spec/fixtures/dsl/subfolder2/common.rb +0 -1
- data/spec/fixtures/dsl/subfolder2/proc2.rb +0 -3
- data/spec/fixtures/dsl/subfolder2/sub/proc3.rb +0 -6
- data/spec/fixtures/dsl/subfolder3.eye +0 -8
- data/spec/fixtures/dsl/subfolder3/common.rb +0 -1
- data/spec/fixtures/dsl/subfolder3/proc4.rb +0 -3
- data/spec/fixtures/dsl/subfolder3/sub/proc5.rb +0 -6
- data/spec/fixtures/dsl/subfolder4.eye +0 -6
- data/spec/fixtures/dsl/subfolder4/a.rb +0 -2
- data/spec/fixtures/dsl/subfolder4/b.rb +0 -1
- data/spec/fixtures/dsl/subfolder4/c.rb +0 -1
- data/spec/mock_spec.rb +0 -31
- data/spec/notify/jabber_spec.rb +0 -25
- data/spec/notify/mail_spec.rb +0 -26
- data/spec/notify_spec.rb +0 -90
- data/spec/process/checks/child_checks_spec.rb +0 -79
- data/spec/process/checks/cpu_spec.rb +0 -114
- data/spec/process/checks/ctime_spec.rb +0 -43
- data/spec/process/checks/fsize_spec.rb +0 -22
- data/spec/process/checks/http_spec.rb +0 -52
- data/spec/process/checks/intergration_spec.rb +0 -32
- data/spec/process/checks/memory_spec.rb +0 -127
- data/spec/process/child_process_spec.rb +0 -125
- data/spec/process/config_spec.rb +0 -74
- data/spec/process/controller_spec.rb +0 -173
- data/spec/process/monitoring_spec.rb +0 -180
- data/spec/process/notify_spec.rb +0 -27
- data/spec/process/restart_spec.rb +0 -186
- data/spec/process/scheduler_spec.rb +0 -178
- data/spec/process/start_spec.rb +0 -261
- data/spec/process/states_history_spec.rb +0 -123
- data/spec/process/stop_spec.rb +0 -156
- data/spec/process/system_spec.rb +0 -136
- data/spec/process/triggers/flapping_spec.rb +0 -242
- data/spec/process/update_config_spec.rb +0 -62
- data/spec/spec_helper.rb +0 -128
- data/spec/support/rr_celluloid.rb +0 -15
- data/spec/support/spec_support.rb +0 -163
- data/spec/system_resources_spec.rb +0 -56
- data/spec/system_spec.rb +0 -174
- data/spec/utils/alive_array_spec.rb +0 -49
- data/spec/utils/celluloid_chain_spec.rb +0 -89
- data/spec/utils/tail_spec.rb +0 -20
data/spec/fixtures/dsl/0.rb
DELETED
data/spec/fixtures/dsl/0a.rb
DELETED
data/spec/fixtures/dsl/0c.rb
DELETED
data/spec/fixtures/dsl/1.rb
DELETED
data/spec/fixtures/dsl/bad.eye
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Eye.config{ http enable: true }
|
@@ -1 +0,0 @@
|
|
1
|
-
Eye.config{ http enable: false }
|
data/spec/fixtures/dsl/empty.eye
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Eye.application("bla") do
|
2
|
-
environment "RAILS_ENV" => "production"
|
3
|
-
keep_alive false
|
4
|
-
stdall "12.log"
|
5
|
-
|
6
|
-
group("ha") do
|
7
|
-
5.times{|i|
|
8
|
-
process("ha_#{i}") do
|
9
|
-
environment "HA" => "1"
|
10
|
-
pid_file "/tmp/#{i}"
|
11
|
-
stdout "11.log"
|
12
|
-
end
|
13
|
-
}
|
14
|
-
end
|
15
|
-
|
16
|
-
process("1") do
|
17
|
-
pid_file "1"
|
18
|
-
stdall "1"
|
19
|
-
end
|
20
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
Eye.app("int") do
|
2
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
3
|
-
stdall "shlak.log"
|
4
|
-
|
5
|
-
group "samples" do
|
6
|
-
process("sample1") do
|
7
|
-
pid_file "1.pid"
|
8
|
-
start_command "ruby sample.rb"
|
9
|
-
daemonize true
|
10
|
-
end
|
11
|
-
|
12
|
-
process("sample2") do
|
13
|
-
pid_file "2.pid"
|
14
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log"
|
15
|
-
checks :memory, :below => 300.megabytes
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
process("forking") do
|
20
|
-
pid_file "forking.pid"
|
21
|
-
start_command "ruby forking.rb start"
|
22
|
-
stop_command "ruby forking.rb stop"
|
23
|
-
|
24
|
-
monitor_children do
|
25
|
-
childs_update_period 5.seconds
|
26
|
-
restart_command "kill -2 {{PID}}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# different from integration.eye, with names of the processes
|
2
|
-
|
3
|
-
Eye.app("int") do
|
4
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
5
|
-
stdall "shlak.log"
|
6
|
-
|
7
|
-
group "samples" do
|
8
|
-
process("sample1_") do
|
9
|
-
pid_file "1.pid"
|
10
|
-
start_command "ruby sample.rb"
|
11
|
-
daemonize true
|
12
|
-
end
|
13
|
-
|
14
|
-
process("sample2_") do
|
15
|
-
pid_file "2.pid"
|
16
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log"
|
17
|
-
checks :memory, :below => 300.megabytes
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
process("forking") do
|
22
|
-
pid_file "forking.pid"
|
23
|
-
start_command "ruby forking.rb start"
|
24
|
-
stop_command "ruby forking.rb stop"
|
25
|
-
|
26
|
-
monitor_children do
|
27
|
-
childs_update_period 5.seconds
|
28
|
-
restart_command "kill -2 {{PID}}"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
Eye.app("int") do
|
2
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
3
|
-
stdall "shlak.log"
|
4
|
-
|
5
|
-
group "samples" do
|
6
|
-
process("sample1") do
|
7
|
-
pid_file "1.pid"
|
8
|
-
start_command "ruby sample.rb -L lock1.lock"
|
9
|
-
daemonize true
|
10
|
-
end
|
11
|
-
|
12
|
-
process("sample2") do
|
13
|
-
pid_file "2.pid"
|
14
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log -L lock2.lock"
|
15
|
-
checks :memory, :below => 300.megabytes
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
process("forking") do
|
20
|
-
pid_file "forking.pid"
|
21
|
-
start_command "ruby forking.rb start"
|
22
|
-
stop_command "ruby forking.rb stop"
|
23
|
-
|
24
|
-
monitor_children do
|
25
|
-
childs_update_period 5.seconds
|
26
|
-
restart_command "kill -2 {{PID}}"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Eye.app("int") do
|
2
|
-
stop_on_delete true # !!!
|
3
|
-
|
4
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
5
|
-
stdall "shlak.log"
|
6
|
-
|
7
|
-
group "samples" do
|
8
|
-
process("sample1") do
|
9
|
-
pid_file "1.pid"
|
10
|
-
start_command "ruby sample.rb"
|
11
|
-
daemonize true
|
12
|
-
end
|
13
|
-
|
14
|
-
process("sample2") do
|
15
|
-
pid_file "2.pid"
|
16
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log"
|
17
|
-
checks :memory, :below => 300.megabytes
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
process("forking") do
|
22
|
-
pid_file "forking.pid"
|
23
|
-
start_command "ruby forking.rb start"
|
24
|
-
stop_command "ruby forking.rb stop"
|
25
|
-
|
26
|
-
monitor_children do
|
27
|
-
childs_update_period 5.seconds
|
28
|
-
restart_command "kill -2 {{PID}}"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Eye.app("int") do
|
2
|
-
stop_on_delete true # !!!
|
3
|
-
|
4
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
5
|
-
stdall "shlak.log"
|
6
|
-
|
7
|
-
group "samples" do
|
8
|
-
process("sample1") do
|
9
|
-
pid_file "1.pid"
|
10
|
-
start_command "ruby sample.rb"
|
11
|
-
daemonize true
|
12
|
-
end
|
13
|
-
|
14
|
-
process("sample2") do
|
15
|
-
pid_file "2.pid"
|
16
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log"
|
17
|
-
checks :memory, :below => 300.megabytes
|
18
|
-
end
|
19
|
-
|
20
|
-
process("sample3") do
|
21
|
-
pid_file "3.pid"
|
22
|
-
start_command "ruby sample.rb"
|
23
|
-
daemonize true
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Eye.app("int") do
|
2
|
-
stop_on_delete true # !!!
|
3
|
-
|
4
|
-
working_dir File.join(File.dirname(__FILE__), %w{.. .. example})
|
5
|
-
stdall "shlak.log"
|
6
|
-
|
7
|
-
group "samples" do
|
8
|
-
process("sample1_") do
|
9
|
-
pid_file "1.pid"
|
10
|
-
start_command "ruby sample.rb"
|
11
|
-
daemonize true
|
12
|
-
end
|
13
|
-
|
14
|
-
process("sample2_") do
|
15
|
-
pid_file "2.pid"
|
16
|
-
start_command "ruby sample.rb -d --pid 2.pid --log shlak.log"
|
17
|
-
checks :memory, :below => 300.megabytes
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
process("forking") do
|
22
|
-
pid_file "forking.pid"
|
23
|
-
start_command "ruby forking.rb start"
|
24
|
-
stop_command "ruby forking.rb stop"
|
25
|
-
|
26
|
-
monitor_children do
|
27
|
-
childs_update_period 5.seconds
|
28
|
-
restart_command "kill -2 {{PID}}"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
data/spec/fixtures/dsl/load.eye
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
Eye.application "app1" do
|
2
|
-
working_dir "/tmp"
|
3
|
-
|
4
|
-
group "gr1" do
|
5
|
-
process("p1"){ pid_file "app1-gr1-p1.pid" }
|
6
|
-
process("p2"){ pid_file "app1-gr1-p2.pid" }
|
7
|
-
end
|
8
|
-
|
9
|
-
group "gr2" do
|
10
|
-
chain :grace => 0.5.seconds
|
11
|
-
process("q3"){ pid_file "app1-gr2-q3.pid" }
|
12
|
-
end
|
13
|
-
|
14
|
-
process("g4"){ pid_file "app1-g4.pid" }
|
15
|
-
process("g5"){ pid_file "app1-g5.pid" }
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
Eye.application "app2" do
|
20
|
-
working_dir "/tmp"
|
21
|
-
|
22
|
-
process "z1" do
|
23
|
-
pid_file "app2-z1.pid"
|
24
|
-
end
|
25
|
-
end
|
data/spec/fixtures/dsl/load2.eye
DELETED
data/spec/fixtures/dsl/load3.eye
DELETED
data/spec/fixtures/dsl/load4.eye
DELETED
data/spec/fixtures/dsl/load5.eye
DELETED
data/spec/fixtures/dsl/load6.eye
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Eye.application "app1" do
|
2
|
-
working_dir "/tmp"
|
3
|
-
|
4
|
-
group "gr2" do
|
5
|
-
chain :grace => 1.0.seconds
|
6
|
-
process("p1"){ pid_file "app1-gr1-p1.pid" }
|
7
|
-
process("p2"){ pid_file "app1-gr1-p2.pid" }
|
8
|
-
end
|
9
|
-
|
10
|
-
group "gr1" do
|
11
|
-
process("q3"){ pid_file "app1-gr2-q3.pid" }
|
12
|
-
end
|
13
|
-
|
14
|
-
process("g4"){ pid_file "app1-g4.pid" }
|
15
|
-
process("g5"){ pid_file "app1-g5.pid" }
|
16
|
-
|
17
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
Eye.application "app1" do
|
2
|
-
working_dir "/tmp"
|
3
|
-
|
4
|
-
group "gr1" do
|
5
|
-
process("p1"){ pid_file "app1-gr1-p1.pid" }
|
6
|
-
process("p2"){ pid_file "app1-gr1-p2.pid" }
|
7
|
-
end
|
8
|
-
|
9
|
-
group "gr2" do
|
10
|
-
chain :grace => 5.seconds
|
11
|
-
process("q3"){ pid_file "app1-gr2-q3.pid" }
|
12
|
-
end
|
13
|
-
|
14
|
-
process("g4"){ pid_file "app1-g4.pid" }
|
15
|
-
process("g5"){ pid_file "app1-g5.pid" }
|
16
|
-
process("gr2and"){ pid_file "app1-gr2and.pid" }
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
Eye.application "app2" do
|
21
|
-
working_dir "/tmp"
|
22
|
-
|
23
|
-
process "z1" do
|
24
|
-
pid_file "app2-z1.pid"
|
25
|
-
end
|
26
|
-
|
27
|
-
group "gr1" do
|
28
|
-
process "z2" do
|
29
|
-
pid_file "app2-gr1-z2.pid"
|
30
|
-
end
|
31
|
-
|
32
|
-
process "gr1and" do
|
33
|
-
pid_file "app2-gr1-gr1and.pid"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|