eye 0.10.0 → 0.10.1.pre
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 +1 -2
- data/bin/leye +1 -3
- data/examples/custom_check.eye +1 -1
- data/examples/custom_trigger.eye +2 -4
- data/lib/eye.rb +2 -2
- data/lib/eye/controller/helpers.rb +9 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5256bf0fc1122a7987c0bbb82d6880b660cde729
|
4
|
+
data.tar.gz: 8935783bf1db9a8f4516928d4840f166701448ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4c9b5df0ef036fe1acc6eff78185a9097648e534cf21eaaa27d7fd1b228971cd6cfc18ab331b97dda44517567de1676a139a4acb06b41f294ecb9b8c849140a
|
7
|
+
data.tar.gz: 227d6f61fa25a9a3fd87b0561b29296c4ce555f9fa32dbae484247cfd89c4bb6476965fb08c87c5dd263b3e423e28a1cf4fad87838c61ef756acebf5151a19bc
|
data/.rubocop.yml
CHANGED
@@ -2,7 +2,6 @@ AllCops:
|
|
2
2
|
Include:
|
3
3
|
- '**/*.eye'
|
4
4
|
Exclude:
|
5
|
-
- 'spec/**/*'
|
6
5
|
- 'lib/eye/utils/mini_active_support.rb'
|
7
6
|
|
8
7
|
Performance/RedundantBlockCall:
|
@@ -43,7 +42,7 @@ Style/RegexpLiteral:
|
|
43
42
|
Layout/AccessModifierIndentation:
|
44
43
|
EnforcedStyle: outdent
|
45
44
|
|
46
|
-
|
45
|
+
Layout/EndAlignment:
|
47
46
|
EnforcedStyleAlignWith: variable
|
48
47
|
|
49
48
|
Layout/IndentHash:
|
data/bin/leye
CHANGED
@@ -28,9 +28,7 @@ unless Eye::Local.eyefile || ENV['EYE_HOME']
|
|
28
28
|
exit 1
|
29
29
|
end
|
30
30
|
|
31
|
-
unless ENV.key?('EYE_HOME')
|
32
|
-
ENV['EYE_HOME'] = File.dirname(Eye::Local.eyefile)
|
33
|
-
end
|
31
|
+
ENV['EYE_HOME'] = File.dirname(Eye::Local.eyefile) unless ENV.key?('EYE_HOME')
|
34
32
|
|
35
33
|
Eye::Local.local_runner = true
|
36
34
|
Eye::Cli.start
|
data/examples/custom_check.eye
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
|
17
17
|
Eye.app :bla do
|
18
18
|
process :a do
|
19
|
-
start_command "ruby -e 'sleep 10; $0 = %{HAHA}.downcase; sleep'"
|
19
|
+
start_command "ruby -e 'sleep 10; $0 = %q{HAHA}.downcase; sleep'"
|
20
20
|
daemonize true
|
21
21
|
pid_file '/tmp/1.pid'
|
22
22
|
check :my_check, every: 1.second, fires: -> { send_signal(:TERM) }
|
data/examples/custom_trigger.eye
CHANGED
@@ -5,16 +5,14 @@ class Eye::Trigger::FixCrash < Eye::Trigger::Custom
|
|
5
5
|
param :times, Integer, nil, 1
|
6
6
|
param_default :to, :up
|
7
7
|
|
8
|
-
def check(
|
8
|
+
def check(*)
|
9
9
|
# process states here like this: [..., :starting, :down, :starting, :down, :starting, :up]
|
10
10
|
states = process.states_history.states
|
11
11
|
|
12
12
|
# states to compare with
|
13
13
|
compare = [:starting, :down] * times + [:starting, :up]
|
14
14
|
|
15
|
-
if states[-compare.length..-1] == compare
|
16
|
-
process.notify(:info, 'yahho, process up')
|
17
|
-
end
|
15
|
+
process.notify(:info, 'yahho, process up') if states[-compare.length..-1] == compare
|
18
16
|
end
|
19
17
|
|
20
18
|
end
|
data/lib/eye.rb
CHANGED
@@ -33,17 +33,19 @@ module Eye::Controller::Helpers
|
|
33
33
|
return process_by_full_name(name) if name.include?(':')
|
34
34
|
|
35
35
|
if app_name
|
36
|
-
app = application_by_name(app_name)
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
if app = application_by_name(app_name)
|
37
|
+
app.groups.each do |gr|
|
38
|
+
p = gr.processes.detect { |c| c.name == name }
|
39
|
+
return p if p
|
40
|
+
end
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
44
|
if group_name
|
44
|
-
gr = group_by_name(group_name)
|
45
|
-
|
46
|
-
|
45
|
+
if gr = group_by_name(group_name)
|
46
|
+
p = gr.processes.detect { |c| c.name == name }
|
47
|
+
return p if p
|
48
|
+
end
|
47
49
|
end
|
48
50
|
|
49
51
|
process_by_name(name)
|
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.10.
|
4
|
+
version: 0.10.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Makarchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
@@ -469,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
469
469
|
version: 1.3.6
|
470
470
|
requirements: []
|
471
471
|
rubyforge_project:
|
472
|
-
rubygems_version: 2.
|
472
|
+
rubygems_version: 2.4.5
|
473
473
|
signing_key:
|
474
474
|
specification_version: 4
|
475
475
|
summary: Process monitoring tool. Inspired from Bluepill and God. Requires Ruby(MRI)
|