bluepill-rwgps 0.0.60
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 +7 -0
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/DESIGN.md +10 -0
- data/Gemfile +10 -0
- data/LICENSE +22 -0
- data/README.md +10 -0
- data/Rakefile +38 -0
- data/bin/bluepill +124 -0
- data/bin/bpsv +3 -0
- data/bin/sample_forking_server +53 -0
- data/bluepill-rwgps.gemspec +36 -0
- data/examples/example.rb +87 -0
- data/examples/new_example.rb +89 -0
- data/examples/new_runit_example.rb +29 -0
- data/examples/runit_example.rb +26 -0
- data/lib/bluepill/application/client.rb +8 -0
- data/lib/bluepill/application/server.rb +23 -0
- data/lib/bluepill/application.rb +205 -0
- data/lib/bluepill/condition_watch.rb +50 -0
- data/lib/bluepill/controller.rb +121 -0
- data/lib/bluepill/dsl/app_proxy.rb +25 -0
- data/lib/bluepill/dsl/process_factory.rb +122 -0
- data/lib/bluepill/dsl/process_proxy.rb +44 -0
- data/lib/bluepill/dsl.rb +12 -0
- data/lib/bluepill/group.rb +72 -0
- data/lib/bluepill/logger.rb +63 -0
- data/lib/bluepill/process.rb +490 -0
- data/lib/bluepill/process_conditions/always_true.rb +18 -0
- data/lib/bluepill/process_conditions/cpu_usage.rb +19 -0
- data/lib/bluepill/process_conditions/http.rb +58 -0
- data/lib/bluepill/process_conditions/mem_usage.rb +32 -0
- data/lib/bluepill/process_conditions/process_condition.rb +22 -0
- data/lib/bluepill/process_conditions.rb +14 -0
- data/lib/bluepill/process_statistics.rb +27 -0
- data/lib/bluepill/socket.rb +58 -0
- data/lib/bluepill/system.rb +238 -0
- data/lib/bluepill/trigger.rb +60 -0
- data/lib/bluepill/triggers/flapping.rb +56 -0
- data/lib/bluepill/util/rotational_array.rb +20 -0
- data/lib/bluepill/version.rb +4 -0
- data/lib/bluepill.rb +38 -0
- data/local-bluepill +129 -0
- data/spec/lib/bluepill/logger_spec.rb +3 -0
- data/spec/lib/bluepill/process_statistics_spec.rb +24 -0
- data/spec/lib/bluepill/system_spec.rb +36 -0
- data/spec/spec_helper.rb +19 -0
- metadata +264 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
describe Bluepill::System do
|
|
2
|
+
describe :pid_alive? do
|
|
3
|
+
it "should be true if process responds to zero signal" do
|
|
4
|
+
mock(::Process).kill(0, 555)
|
|
5
|
+
Bluepill::System.should be_pid_alive(555)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it "should be false if process throws exception on zero signal" do
|
|
9
|
+
mock(::Process).kill(0, 555) { raise Errno::ESRCH.new }
|
|
10
|
+
Bluepill::System.should_not be_pid_alive(555)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe :store do
|
|
15
|
+
it "should be Hash" do
|
|
16
|
+
Bluepill::System.store.should be_kind_of(Hash)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should return same Hash or every call" do
|
|
20
|
+
Bluepill::System.store.should be_equal(Bluepill::System.store)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it "should store assigned pairs" do
|
|
24
|
+
Bluepill::System.store[:somekey] = 10
|
|
25
|
+
Bluepill::System.store[:somekey].should be_eql(10)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe :reset_data do
|
|
30
|
+
it 'should clear the #store' do
|
|
31
|
+
Bluepill::System.store[:anotherkey] = Faker::Lorem.sentence
|
|
32
|
+
Bluepill::System.reset_data
|
|
33
|
+
Bluepill::System.store.should be_empty
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
if RUBY_VERSION >= '1.9'
|
|
2
|
+
if ENV['ENABLE_SIMPLECOV']
|
|
3
|
+
require 'simplecov'
|
|
4
|
+
SimpleCov.start
|
|
5
|
+
end
|
|
6
|
+
else
|
|
7
|
+
require 'rubygems'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
require 'faker'
|
|
11
|
+
require 'rspec/core'
|
|
12
|
+
|
|
13
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', File.dirname(__FILE__)))
|
|
14
|
+
|
|
15
|
+
RSpec.configure do |conf|
|
|
16
|
+
conf.mock_with :rr
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
require 'bluepill'
|
metadata
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: bluepill-rwgps
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.60
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Cullen King
|
|
8
|
+
- Arya Asemanfar
|
|
9
|
+
- Gary Tsang
|
|
10
|
+
- Rohith Ravi
|
|
11
|
+
autorequire:
|
|
12
|
+
bindir: bin
|
|
13
|
+
cert_chain: []
|
|
14
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
|
15
|
+
dependencies:
|
|
16
|
+
- !ruby/object:Gem::Dependency
|
|
17
|
+
name: daemons
|
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
|
19
|
+
requirements:
|
|
20
|
+
- - ~>
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 1.1.4
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 1.1.4
|
|
30
|
+
- !ruby/object:Gem::Dependency
|
|
31
|
+
name: state_machine
|
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ~>
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: 1.1.0
|
|
37
|
+
type: :runtime
|
|
38
|
+
prerelease: false
|
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ~>
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: 1.1.0
|
|
44
|
+
- !ruby/object:Gem::Dependency
|
|
45
|
+
name: activesupport
|
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
- - '>='
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: '3'
|
|
51
|
+
- - <
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '4.1'
|
|
54
|
+
type: :runtime
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - '>='
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '3'
|
|
61
|
+
- - <
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '4.1'
|
|
64
|
+
- !ruby/object:Gem::Dependency
|
|
65
|
+
name: i18n
|
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
|
67
|
+
requirements:
|
|
68
|
+
- - '>='
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: 0.5.0
|
|
71
|
+
type: :runtime
|
|
72
|
+
prerelease: false
|
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
74
|
+
requirements:
|
|
75
|
+
- - '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 0.5.0
|
|
78
|
+
- !ruby/object:Gem::Dependency
|
|
79
|
+
name: bundler
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - '>='
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: 1.0.10
|
|
85
|
+
type: :development
|
|
86
|
+
prerelease: false
|
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
88
|
+
requirements:
|
|
89
|
+
- - '>='
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: 1.0.10
|
|
92
|
+
- !ruby/object:Gem::Dependency
|
|
93
|
+
name: rake
|
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
|
95
|
+
requirements:
|
|
96
|
+
- - '!='
|
|
97
|
+
- !ruby/object:Gem::Version
|
|
98
|
+
version: 0.9.0
|
|
99
|
+
type: :development
|
|
100
|
+
prerelease: false
|
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
102
|
+
requirements:
|
|
103
|
+
- - '!='
|
|
104
|
+
- !ruby/object:Gem::Version
|
|
105
|
+
version: 0.9.0
|
|
106
|
+
- !ruby/object:Gem::Dependency
|
|
107
|
+
name: rspec-core
|
|
108
|
+
requirement: !ruby/object:Gem::Requirement
|
|
109
|
+
requirements:
|
|
110
|
+
- - ~>
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: '2.0'
|
|
113
|
+
type: :development
|
|
114
|
+
prerelease: false
|
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
116
|
+
requirements:
|
|
117
|
+
- - ~>
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: '2.0'
|
|
120
|
+
- !ruby/object:Gem::Dependency
|
|
121
|
+
name: rspec-expectations
|
|
122
|
+
requirement: !ruby/object:Gem::Requirement
|
|
123
|
+
requirements:
|
|
124
|
+
- - ~>
|
|
125
|
+
- !ruby/object:Gem::Version
|
|
126
|
+
version: '2.0'
|
|
127
|
+
type: :development
|
|
128
|
+
prerelease: false
|
|
129
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
130
|
+
requirements:
|
|
131
|
+
- - ~>
|
|
132
|
+
- !ruby/object:Gem::Version
|
|
133
|
+
version: '2.0'
|
|
134
|
+
- !ruby/object:Gem::Dependency
|
|
135
|
+
name: rr
|
|
136
|
+
requirement: !ruby/object:Gem::Requirement
|
|
137
|
+
requirements:
|
|
138
|
+
- - ~>
|
|
139
|
+
- !ruby/object:Gem::Version
|
|
140
|
+
version: '1.0'
|
|
141
|
+
type: :development
|
|
142
|
+
prerelease: false
|
|
143
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
144
|
+
requirements:
|
|
145
|
+
- - ~>
|
|
146
|
+
- !ruby/object:Gem::Version
|
|
147
|
+
version: '1.0'
|
|
148
|
+
- !ruby/object:Gem::Dependency
|
|
149
|
+
name: faker
|
|
150
|
+
requirement: !ruby/object:Gem::Requirement
|
|
151
|
+
requirements:
|
|
152
|
+
- - ~>
|
|
153
|
+
- !ruby/object:Gem::Version
|
|
154
|
+
version: '0.9'
|
|
155
|
+
type: :development
|
|
156
|
+
prerelease: false
|
|
157
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
158
|
+
requirements:
|
|
159
|
+
- - ~>
|
|
160
|
+
- !ruby/object:Gem::Version
|
|
161
|
+
version: '0.9'
|
|
162
|
+
- !ruby/object:Gem::Dependency
|
|
163
|
+
name: yard
|
|
164
|
+
requirement: !ruby/object:Gem::Requirement
|
|
165
|
+
requirements:
|
|
166
|
+
- - ~>
|
|
167
|
+
- !ruby/object:Gem::Version
|
|
168
|
+
version: '0.7'
|
|
169
|
+
type: :development
|
|
170
|
+
prerelease: false
|
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
172
|
+
requirements:
|
|
173
|
+
- - ~>
|
|
174
|
+
- !ruby/object:Gem::Version
|
|
175
|
+
version: '0.7'
|
|
176
|
+
description: The original bluepill process monitor worked well. In 2013 several changes
|
|
177
|
+
were introduced that were detrimental to the stability of bluepill, as well as the
|
|
178
|
+
system running it. This fork reverts back to the stable/non-destructive code.
|
|
179
|
+
email:
|
|
180
|
+
- cullenk@gmail.com
|
|
181
|
+
executables:
|
|
182
|
+
- bluepill
|
|
183
|
+
- bpsv
|
|
184
|
+
- sample_forking_server
|
|
185
|
+
extensions: []
|
|
186
|
+
extra_rdoc_files:
|
|
187
|
+
- LICENSE
|
|
188
|
+
- README.md
|
|
189
|
+
files:
|
|
190
|
+
- .gitignore
|
|
191
|
+
- .rspec
|
|
192
|
+
- DESIGN.md
|
|
193
|
+
- Gemfile
|
|
194
|
+
- LICENSE
|
|
195
|
+
- README.md
|
|
196
|
+
- Rakefile
|
|
197
|
+
- bin/bluepill
|
|
198
|
+
- bin/bpsv
|
|
199
|
+
- bin/sample_forking_server
|
|
200
|
+
- bluepill-rwgps.gemspec
|
|
201
|
+
- examples/example.rb
|
|
202
|
+
- examples/new_example.rb
|
|
203
|
+
- examples/new_runit_example.rb
|
|
204
|
+
- examples/runit_example.rb
|
|
205
|
+
- lib/bluepill.rb
|
|
206
|
+
- lib/bluepill/application.rb
|
|
207
|
+
- lib/bluepill/application/client.rb
|
|
208
|
+
- lib/bluepill/application/server.rb
|
|
209
|
+
- lib/bluepill/condition_watch.rb
|
|
210
|
+
- lib/bluepill/controller.rb
|
|
211
|
+
- lib/bluepill/dsl.rb
|
|
212
|
+
- lib/bluepill/dsl/app_proxy.rb
|
|
213
|
+
- lib/bluepill/dsl/process_factory.rb
|
|
214
|
+
- lib/bluepill/dsl/process_proxy.rb
|
|
215
|
+
- lib/bluepill/group.rb
|
|
216
|
+
- lib/bluepill/logger.rb
|
|
217
|
+
- lib/bluepill/process.rb
|
|
218
|
+
- lib/bluepill/process_conditions.rb
|
|
219
|
+
- lib/bluepill/process_conditions/always_true.rb
|
|
220
|
+
- lib/bluepill/process_conditions/cpu_usage.rb
|
|
221
|
+
- lib/bluepill/process_conditions/http.rb
|
|
222
|
+
- lib/bluepill/process_conditions/mem_usage.rb
|
|
223
|
+
- lib/bluepill/process_conditions/process_condition.rb
|
|
224
|
+
- lib/bluepill/process_statistics.rb
|
|
225
|
+
- lib/bluepill/socket.rb
|
|
226
|
+
- lib/bluepill/system.rb
|
|
227
|
+
- lib/bluepill/trigger.rb
|
|
228
|
+
- lib/bluepill/triggers/flapping.rb
|
|
229
|
+
- lib/bluepill/util/rotational_array.rb
|
|
230
|
+
- lib/bluepill/version.rb
|
|
231
|
+
- local-bluepill
|
|
232
|
+
- spec/lib/bluepill/logger_spec.rb
|
|
233
|
+
- spec/lib/bluepill/process_statistics_spec.rb
|
|
234
|
+
- spec/lib/bluepill/system_spec.rb
|
|
235
|
+
- spec/spec_helper.rb
|
|
236
|
+
homepage: http://github.com/kingcu/bluepill-rwgps
|
|
237
|
+
licenses: []
|
|
238
|
+
metadata: {}
|
|
239
|
+
post_install_message:
|
|
240
|
+
rdoc_options: []
|
|
241
|
+
require_paths:
|
|
242
|
+
- lib
|
|
243
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
244
|
+
requirements:
|
|
245
|
+
- - '>='
|
|
246
|
+
- !ruby/object:Gem::Version
|
|
247
|
+
version: '0'
|
|
248
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
|
+
requirements:
|
|
250
|
+
- - '>='
|
|
251
|
+
- !ruby/object:Gem::Version
|
|
252
|
+
version: '0'
|
|
253
|
+
requirements: []
|
|
254
|
+
rubyforge_project:
|
|
255
|
+
rubygems_version: 2.0.5
|
|
256
|
+
signing_key:
|
|
257
|
+
specification_version: 4
|
|
258
|
+
summary: Fork of bluepill process monitory, reverting back to stable code with no
|
|
259
|
+
global PID journal.
|
|
260
|
+
test_files:
|
|
261
|
+
- spec/lib/bluepill/logger_spec.rb
|
|
262
|
+
- spec/lib/bluepill/process_statistics_spec.rb
|
|
263
|
+
- spec/lib/bluepill/system_spec.rb
|
|
264
|
+
- spec/spec_helper.rb
|