eye 0.9.2 → 0.9.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/.rubocop.yml +27 -9
- data/CHANGES.md +5 -0
- data/Gemfile +2 -1
- data/README.md +3 -3
- data/Rakefile +3 -3
- data/examples/custom_check.eye +1 -1
- data/examples/plugin/plugin.rb +0 -1
- data/examples/processes/em.rb +2 -1
- data/examples/processes/sample.rb +0 -1
- data/examples/processes/thin.ru +2 -1
- data/lib/eye.rb +2 -2
- data/lib/eye/application.rb +1 -1
- data/lib/eye/checker.rb +1 -4
- data/lib/eye/child_process.rb +2 -1
- data/lib/eye/config.rb +5 -5
- data/lib/eye/logger.rb +1 -1
- data/lib/eye/notify.rb +1 -3
- data/lib/eye/process/children.rb +1 -0
- data/lib/eye/process/commands.rb +6 -1
- data/lib/eye/process/data.rb +1 -1
- data/lib/eye/process/scheduler.rb +1 -1
- data/lib/eye/process/trigger.rb +1 -1
- data/lib/eye/process/watchers.rb +1 -1
- data/lib/eye/system_resources.rb +2 -1
- data/lib/eye/trigger.rb +1 -2
- data/lib/eye/trigger/check_dependency.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fb55aab9464c85b0d2f52d9ecb83f2ef8f6cbc7
|
4
|
+
data.tar.gz: b36569fbe32ec49ece27216d1fbb340750a6116d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1de45573f67e9a8b0b8a7a3d93ef19396d0561bcf780d73cb9eee63de3607958c1c634a6edd48556c95460492b407b05ee536cc5489974073f6618354b629cb2
|
7
|
+
data.tar.gz: 51c5d3ebd48ad1b339a493897a00fe354ee4d9b1c884c53ff198ba253d27a3216c909a248166d6c18591f06460becb0029fedc93db13bd0319953beded5ec94f
|
data/.rubocop.yml
CHANGED
@@ -27,10 +27,10 @@ Style/MutableConstant:
|
|
27
27
|
Style/ClassAndModuleChildren:
|
28
28
|
EnforcedStyle: compact
|
29
29
|
|
30
|
-
|
30
|
+
Layout/EmptyLinesAroundClassBody:
|
31
31
|
EnforcedStyle: empty_lines
|
32
32
|
|
33
|
-
|
33
|
+
Layout/EmptyLinesAroundModuleBody:
|
34
34
|
EnforcedStyle: empty_lines
|
35
35
|
Exclude:
|
36
36
|
- 'lib/eye.rb'
|
@@ -40,13 +40,13 @@ Style/RegexpLiteral:
|
|
40
40
|
Exclude:
|
41
41
|
- 'examples/**/*'
|
42
42
|
|
43
|
-
|
43
|
+
Layout/AccessModifierIndentation:
|
44
44
|
EnforcedStyle: outdent
|
45
45
|
|
46
46
|
Lint/EndAlignment:
|
47
|
-
|
47
|
+
EnforcedStyleAlignWith: variable
|
48
48
|
|
49
|
-
|
49
|
+
Layout/IndentHash:
|
50
50
|
EnforcedStyle: consistent
|
51
51
|
|
52
52
|
Style/Lambda:
|
@@ -57,9 +57,9 @@ Style/BlockDelimiters:
|
|
57
57
|
Exclude:
|
58
58
|
- 'examples/**/*'
|
59
59
|
|
60
|
-
|
60
|
+
Layout/CaseIndentation:
|
61
61
|
IndentOneStep: true
|
62
|
-
|
62
|
+
EnforcedStyle: end
|
63
63
|
|
64
64
|
Style/HashSyntax:
|
65
65
|
Exclude:
|
@@ -132,7 +132,7 @@ Style/Documentation:
|
|
132
132
|
Style/DoubleNegation:
|
133
133
|
Enabled: false
|
134
134
|
|
135
|
-
|
135
|
+
Security/Eval:
|
136
136
|
Enabled: false
|
137
137
|
|
138
138
|
Lint/Void:
|
@@ -144,7 +144,7 @@ Lint/Void:
|
|
144
144
|
Lint/AssignmentInCondition:
|
145
145
|
Enabled: false
|
146
146
|
|
147
|
-
|
147
|
+
Naming/AccessorMethodName:
|
148
148
|
Enabled: false
|
149
149
|
|
150
150
|
Style/SpecialGlobalVars:
|
@@ -161,3 +161,21 @@ Lint/LiteralInInterpolation:
|
|
161
161
|
- 'lib/eye/notify/jabber.rb'
|
162
162
|
- 'lib/eye/notify/slack.rb'
|
163
163
|
- 'lib/eye/process/commands.rb'
|
164
|
+
|
165
|
+
Style/FrozenStringLiteralComment:
|
166
|
+
Enabled: false
|
167
|
+
|
168
|
+
Style/SymbolArray:
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
Style/SafeNavigation:
|
172
|
+
Enabled: false
|
173
|
+
|
174
|
+
Security/MarshalLoad:
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Gemspec/OrderedDependencies:
|
178
|
+
Enabled: false
|
179
|
+
|
180
|
+
Style/Dir:
|
181
|
+
Enabled: false
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,10 +10,10 @@ Little demo, shows general commands and how chain works:
|
|
10
10
|
|
11
11
|
[](https://raw.github.com/kostya/stuff/master/eye/eye.gif)
|
12
12
|
|
13
|
-
|
13
|
+
Installation:
|
14
14
|
|
15
|
-
$
|
16
|
-
$
|
15
|
+
$ gem install sigar -- --with-cppflags="-fgnu89-inline"
|
16
|
+
$ gem install eye
|
17
17
|
|
18
18
|
|
19
19
|
### Why?
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'coveralls/rake/task'
|
|
5
5
|
|
6
6
|
Coveralls::RakeTask.new
|
7
7
|
|
8
|
-
task :
|
8
|
+
task default: :split_test
|
9
9
|
|
10
10
|
desc 'run parallel tests'
|
11
11
|
task :pspec do
|
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
task :remove_coverage do
|
26
26
|
require 'fileutils'
|
27
|
-
FileUtils.rm_rf(File.expand_path(File.join(File.dirname(__FILE__), %w
|
27
|
+
FileUtils.rm_rf(File.expand_path(File.join(File.dirname(__FILE__), %w[coverage])))
|
28
28
|
end
|
29
29
|
|
30
30
|
task :env do
|
@@ -35,6 +35,6 @@ task :env do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
desc 'graph'
|
38
|
-
task :
|
38
|
+
task graph: :env do
|
39
39
|
StateMachine::Machine.draw('Eye::Process')
|
40
40
|
end
|
data/examples/custom_check.eye
CHANGED
data/examples/plugin/plugin.rb
CHANGED
data/examples/processes/em.rb
CHANGED
@@ -39,7 +39,8 @@ class EchoObj < EM::Connection
|
|
39
39
|
puts '-- someone connected to the echo server!'
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
# {:command => 'ping'}
|
43
|
+
def receive_object(obj)
|
43
44
|
puts "receive #{obj.inspect}"
|
44
45
|
send_object(answer(obj[:command]).chop)
|
45
46
|
end
|
data/examples/processes/thin.ru
CHANGED
data/lib/eye.rb
CHANGED
data/lib/eye/application.rb
CHANGED
data/lib/eye/checker.rb
CHANGED
@@ -50,7 +50,6 @@ class Eye::Checker
|
|
50
50
|
|
51
51
|
def self.create(pid, options = {}, process = nil)
|
52
52
|
get_class(options[:type]).new(pid, options, process)
|
53
|
-
|
54
53
|
rescue Object => ex
|
55
54
|
log_ex(ex)
|
56
55
|
nil
|
@@ -128,7 +127,6 @@ class Eye::Checker
|
|
128
127
|
|
129
128
|
info { "#{last_human_values} => #{result ? 'OK' : 'Fail'}" }
|
130
129
|
result
|
131
|
-
|
132
130
|
rescue Object => ex
|
133
131
|
raise(ex) if ex.class == Celluloid::TaskTerminated
|
134
132
|
log_ex(ex)
|
@@ -221,8 +219,7 @@ class Eye::Checker
|
|
221
219
|
Eye::Checker.const_set(name, base)
|
222
220
|
end
|
223
221
|
|
224
|
-
def self.requires
|
225
|
-
end
|
222
|
+
def self.requires; end
|
226
223
|
|
227
224
|
class CustomCell < Eye::Checker
|
228
225
|
|
data/lib/eye/child_process.rb
CHANGED
data/lib/eye/config.rb
CHANGED
@@ -95,8 +95,8 @@ class Eye::Config
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def each_process(&block)
|
98
|
-
applications.
|
99
|
-
(app_cfg[:groups] || {}).
|
98
|
+
applications.each do |_, app_cfg|
|
99
|
+
(app_cfg[:groups] || {}).each do |_, gr_cfg|
|
100
100
|
(gr_cfg[:processes] || {}).each_value(&block)
|
101
101
|
end
|
102
102
|
end
|
@@ -111,14 +111,14 @@ class Eye::Config
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def delete_group(name)
|
114
|
-
applications.each do |
|
114
|
+
applications.each do |_, app_cfg|
|
115
115
|
(app_cfg[:groups] || {}).delete(name)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
119
|
def delete_process(name)
|
120
|
-
applications.each do |
|
121
|
-
(app_cfg[:groups] || {}).each do |
|
120
|
+
applications.each do |_, app_cfg|
|
121
|
+
(app_cfg[:groups] || {}).each do |_, gr_cfg|
|
122
122
|
(gr_cfg[:processes] || {}).delete(name)
|
123
123
|
end
|
124
124
|
end
|
data/lib/eye/logger.rb
CHANGED
data/lib/eye/notify.rb
CHANGED
@@ -47,7 +47,6 @@ class Eye::Notify
|
|
47
47
|
else
|
48
48
|
create_proc[needed_hash]
|
49
49
|
end
|
50
|
-
|
51
50
|
rescue Object => ex
|
52
51
|
log_ex(ex)
|
53
52
|
end
|
@@ -99,8 +98,7 @@ class Eye::Notify
|
|
99
98
|
Eye::Dsl::ConfigOpts.add_notify(type)
|
100
99
|
end
|
101
100
|
|
102
|
-
def self.requires
|
103
|
-
end
|
101
|
+
def self.requires; end
|
104
102
|
|
105
103
|
class Custom < Eye::Notify
|
106
104
|
|
data/lib/eye/process/children.rb
CHANGED
data/lib/eye/process/commands.rb
CHANGED
@@ -229,7 +229,7 @@ private
|
|
229
229
|
|
230
230
|
sleep_grace(:start_grace)
|
231
231
|
|
232
|
-
case load_external_pid_file
|
232
|
+
case load_res = load_external_pid_file
|
233
233
|
when :ok
|
234
234
|
res.merge(pid: self.pid)
|
235
235
|
when :no_pid_file
|
@@ -241,6 +241,11 @@ private
|
|
241
241
|
error "exit status #{res[:exitstatus]}, process <#{@last_loaded_pid}> (from #{self[:pid_file_ex]}) was not found; " \
|
242
242
|
"ensure that the pid_file is being updated correctly (#{check_logs_str})"
|
243
243
|
{ error: :not_really_running }
|
244
|
+
else
|
245
|
+
# really strange case
|
246
|
+
error "exit status #{res[:exitstatus]}, process <#{@last_loaded_pid}> (from #{self[:pid_file_ex]}) #{load_res}; " \
|
247
|
+
"this is really strange case, like timestamp of server was updated, may be need to reload eye (#{check_logs_str})"
|
248
|
+
{ error: load_res }
|
244
249
|
end
|
245
250
|
end
|
246
251
|
|
data/lib/eye/process/data.rb
CHANGED
@@ -92,7 +92,7 @@ module Eye::Process::Scheduler
|
|
92
92
|
return false if call[:by] != :user && equal_action_call?(@scheduled_call, call)
|
93
93
|
|
94
94
|
# check any equal call in queue scheduler_calls
|
95
|
-
|
95
|
+
scheduler_calls.none? { |c| equal_action_call?(c, call) }
|
96
96
|
end
|
97
97
|
|
98
98
|
def equal_action_call?(call1, call2)
|
data/lib/eye/process/trigger.rb
CHANGED
data/lib/eye/process/watchers.rb
CHANGED
data/lib/eye/system_resources.rb
CHANGED
data/lib/eye/trigger.rb
CHANGED
@@ -13,7 +13,7 @@ private
|
|
13
13
|
Eye::Control.find_nearest_process(name, process.group_name_pure, process.app_name)
|
14
14
|
end
|
15
15
|
|
16
|
-
processes = processes.compact.
|
16
|
+
processes = processes.compact.reject { |p| p.state_name == :unmonitored }
|
17
17
|
return if processes.empty?
|
18
18
|
processes = Eye::Utils::AliveArray.new(processes)
|
19
19
|
|
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.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Makarchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|