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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7595c3f4ae6cd9b50b345953fa1d37058e715ff1
4
- data.tar.gz: c553a8d872b7275630adbef3e7922ea6a369ee9f
3
+ metadata.gz: 7fffb77f4cc603053d06b479ec908b9bbb3b25a0
4
+ data.tar.gz: b9b670152526f2ce4c90fb79e58790305062c4fd
5
5
  SHA512:
6
- metadata.gz: 873f95cd4f5f23b30ba66dcb0b73e6402693f10bddf555fdfe074f0feee4d707b26a3db5664f22bf162306c7ff70f323bb0d90dae277c8ec37a1e61a2e42da1d
7
- data.tar.gz: 6c01cf888e740a4deb1f2f1d90727971075ba09b89cf833092f44b57a5cd73c1619beb851a0214adeb5334e45e2418ab18ffe2d73d068395de023a97cd7d7607
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)
@@ -1,5 +1,5 @@
1
1
  module Eye
2
2
  module Patch
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
@@ -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:
@@ -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.0
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-03-30 00:00:00.000000000 Z
11
+ date: 2017-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eye