eye-patch 0.4.0 → 0.4.1
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/lib/eye/patch/process_set.rb +9 -0
- data/lib/eye/patch/version.rb +1 -1
- data/test/fixtures/test.yml +7 -0
- data/test/lib/eye/patch_test.rb +15 -0
- 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: 7fffb77f4cc603053d06b479ec908b9bbb3b25a0
|
4
|
+
data.tar.gz: b9b670152526f2ce4c90fb79e58790305062c4fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da0fe8339911f4092a66fe4e0a8a89fee214f5c75d4510e235076f8567a679316694614050315ef8cc7a218265e4e5ce252b0fea538507f15812a010d82b56dd
|
7
|
+
data.tar.gz: a5947a846ead1b54c5db62befd6cfffdb1a75c1892b3319ca9a16fca8f608beacf3f33c570dcd26c8ab12984c23ddea26850a291c223b0badd2988ab075c383f
|
@@ -41,6 +41,15 @@ module Eye::Patch
|
|
41
41
|
|
42
42
|
self[name][:triggers] = self[name][:triggers].merge(monitors[:triggers])
|
43
43
|
self[name][:checks] = self[name][:checks].merge(monitors[:checks])
|
44
|
+
|
45
|
+
return unless config[:monitor_children]
|
46
|
+
return unless config[:monitor_children][:checks]
|
47
|
+
|
48
|
+
monitor_options = OptionSet.new(
|
49
|
+
Eye::Checker,
|
50
|
+
config[:monitor_children][:checks])
|
51
|
+
|
52
|
+
self[name][:monitor_children][:checks] = monitor_options
|
44
53
|
end
|
45
54
|
|
46
55
|
def indexed_config(config, index)
|
data/lib/eye/patch/version.rb
CHANGED
data/test/fixtures/test.yml
CHANGED
@@ -34,6 +34,13 @@ processes:
|
|
34
34
|
start_command: bundle exec my-process
|
35
35
|
pid_file: tmp/pids/my-process.pid
|
36
36
|
stdall: log/my-process.log
|
37
|
+
monitor_children:
|
38
|
+
checks:
|
39
|
+
- name: memory
|
40
|
+
config:
|
41
|
+
times: 2
|
42
|
+
every: 10 seconds
|
43
|
+
below: 512 megabytes
|
37
44
|
- name: first-grouped-process
|
38
45
|
group: my-group
|
39
46
|
config:
|
data/test/lib/eye/patch_test.rb
CHANGED
@@ -76,6 +76,21 @@ describe Eye::Patch do
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
it "loads children-level checks" do
|
80
|
+
process = @application[:groups]["__default__"][:processes].values.first
|
81
|
+
process_config = @original["processes"].detect do |p|
|
82
|
+
p["name"] == process[:name]
|
83
|
+
end
|
84
|
+
check = process_config["config"]["monitor_children"]["checks"].first
|
85
|
+
parsed_check = process[:monitor_children][:checks][check["name"].to_sym]
|
86
|
+
|
87
|
+
%w(times every below).each do |setting|
|
88
|
+
assert_equal(
|
89
|
+
Eye::Patch::ValueParser.parse(check["config"][setting]),
|
90
|
+
parsed_check[setting.to_sym])
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
79
94
|
it "passes application configurations down to processes" do
|
80
95
|
process = @application[:groups]["__default__"][:processes].values.first
|
81
96
|
assert_equal @application[:triggers], process[:triggers]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eye-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eye
|