big_brother 0.6.8 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,40 +1,66 @@
1
1
  ---
2
- test1:
3
- check_interval: 1
4
- scheduler: wrr
5
- fwmark: 1
6
- ramp_up_time: 120
7
- has_downpage: true
8
- nagios:
9
- server: nsca.host
10
- check: test1_status
11
- host: prod-load
12
- nodes:
13
- - address: 127.0.0.1
14
- port: 9001
15
- path: /test/valid
16
- - address: 127.0.0.1
17
- port: 9002
18
- path: /test/valid
19
- test2:
20
- check_interval: 2
21
- scheduler: wrr
22
- fwmark: 2
23
- nodes:
24
- - address: 127.0.0.1
25
- port: 9001
26
- path: /test/invalid
27
- - address: 127.0.0.1
28
- port: 9002
29
- path: /test/invalid
30
- test3:
31
- check_interval: 1
32
- scheduler: wrr
33
- fwmark: 3
34
- nodes:
35
- - address: 127.0.0.1
36
- port: 9001
37
- path: /test/valid
38
- - address: 127.0.0.1
39
- port: 9002
40
- path: /test/invalid
2
+ _big_brother:
3
+ offset: 10000
4
+ clusters:
5
+ - cluster_name: test1
6
+ check_interval: 1
7
+ backend_mode: "active_passive"
8
+ scheduler: wrr
9
+ fwmark: 1
10
+ ramp_up_time: 120
11
+ has_downpage: true
12
+ nagios:
13
+ server: nsca.host
14
+ check: test1_status
15
+ host: prod-load
16
+ nodes:
17
+ - address: 127.0.0.1
18
+ port: 9001
19
+ max_weight:
20
+ path: /test/valid
21
+ priority: 0
22
+ - address: 127.0.0.1
23
+ port: 9002
24
+ path: /test/valid
25
+ priority: 1
26
+ - cluster_name: test2
27
+ check_interval: 2
28
+ scheduler: wrr
29
+ fwmark: 2
30
+ nodes:
31
+ - address: 127.0.0.1
32
+ port: 9001
33
+ max_weight:
34
+ path: /test/invalid
35
+ - address: 127.0.0.1
36
+ port: 9002
37
+ path: /test/invalid
38
+ - cluster_name: test3
39
+ check_interval: 1
40
+ scheduler: wrr
41
+ fwmark: 3
42
+ nodes:
43
+ - address: 127.0.0.1
44
+ port: 9001
45
+ max_weight:
46
+ path: /test/valid
47
+ - address: 127.0.0.1
48
+ port: 9002
49
+ path: /test/invalid
50
+ - cluster_name: test4
51
+ check_interval: 1
52
+ scheduler: wrr
53
+ fwmark: 4
54
+ max_down_ticks: 100
55
+ backend_mode: 'active_active'
56
+ non_egress_locations:
57
+ - 'test'
58
+ nodes:
59
+ - address: 127.0.0.1
60
+ port: 9001
61
+ path: /test/valid
62
+ max_weight:
63
+ - address: 196.168.0.2
64
+ port: 9292
65
+ interpol: true
66
+ path: /fwmark
@@ -1,6 +1,6 @@
1
1
  class Factory
2
2
  def self.cluster(overrides = {})
3
- BigBrother::Cluster.new(
3
+ BigBrother::ClusterFactory.create_cluster(
4
4
  overrides.fetch(:name, 'test'),
5
5
  {
6
6
  :fwmark => 100,
@@ -11,4 +11,12 @@ class Factory
11
11
  }.merge(overrides)
12
12
  )
13
13
  end
14
+
15
+ def self.active_passive_cluster(overrides = {})
16
+ self.cluster(overrides.merge(:backend_mode => BigBrother::ClusterFactory::ACTIVE_PASSIVE_CLUSTER))
17
+ end
18
+
19
+ def self.active_active_cluster(overrides = {})
20
+ self.cluster(overrides.merge(:backend_mode => BigBrother::ClusterFactory::ACTIVE_ACTIVE_CLUSTER))
21
+ end
14
22
  end
@@ -1,8 +1,17 @@
1
1
  class NullLogger
2
+ def initialize(store=nil)
3
+ @store = store
4
+ end
5
+
6
+ def messages
7
+ @store
8
+ end
9
+
2
10
  def write(msg)
3
11
  end
4
12
 
5
13
  def info(msg)
14
+ @store << msg if @store.is_a?(Array)
6
15
  end
7
16
 
8
17
  def debug(msg)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big_brother
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.8.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-14 00:00:00.000000000 Z
12
+ date: 2015-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thin
@@ -155,6 +155,22 @@ dependencies:
155
155
  - - ~>
156
156
  - !ruby/object:Gem::Version
157
157
  version: 0.0.2
158
+ - !ruby/object:Gem::Dependency
159
+ name: kwalify
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ~>
164
+ - !ruby/object:Gem::Version
165
+ version: 0.7.2
166
+ type: :runtime
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: 0.7.2
158
174
  - !ruby/object:Gem::Dependency
159
175
  name: rspec
160
176
  requirement: !ruby/object:Gem::Requirement
@@ -219,22 +235,6 @@ dependencies:
219
235
  - - ~>
220
236
  - !ruby/object:Gem::Version
221
237
  version: '0.13'
222
- - !ruby/object:Gem::Dependency
223
- name: vagrant
224
- requirement: !ruby/object:Gem::Requirement
225
- none: false
226
- requirements:
227
- - - ! '>='
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
- requirements:
235
- - - ! '>='
236
- - !ruby/object:Gem::Version
237
- version: '0'
238
238
  description: IPVS backend supervisor
239
239
  email:
240
240
  - code@getbraintree.com
@@ -247,6 +247,7 @@ files:
247
247
  - .rake_commit
248
248
  - .rvmrc
249
249
  - .travis.yml
250
+ - Changelog.md
250
251
  - Gemfile
251
252
  - LICENSE
252
253
  - README.md
@@ -255,10 +256,13 @@ files:
255
256
  - bin/bigbro
256
257
  - config.ru
257
258
  - lib/big_brother.rb
259
+ - lib/big_brother/active_active_cluster.rb
260
+ - lib/big_brother/active_passive_cluster.rb
258
261
  - lib/big_brother/app.rb
259
262
  - lib/big_brother/cli.rb
260
263
  - lib/big_brother/cluster.rb
261
264
  - lib/big_brother/cluster_collection.rb
265
+ - lib/big_brother/cluster_factory.rb
262
266
  - lib/big_brother/configuration.rb
263
267
  - lib/big_brother/health_fetcher.rb
264
268
  - lib/big_brother/ipvs.rb
@@ -269,12 +273,16 @@ files:
269
273
  - lib/big_brother/status_file.rb
270
274
  - lib/big_brother/ticker.rb
271
275
  - lib/big_brother/version.rb
276
+ - lib/resources/config_schema.yml
272
277
  - lib/sinatra/synchrony.rb
273
278
  - lib/thin/backends/tcp_server_with_callbacks.rb
274
279
  - lib/thin/callback_rack_handler.rb
275
280
  - lib/thin/callbacks.rb
281
+ - spec/big_brother/active_active_cluster_spec.rb
282
+ - spec/big_brother/active_passive_cluster_spec.rb
276
283
  - spec/big_brother/app_spec.rb
277
284
  - spec/big_brother/cluster_collection_spec.rb
285
+ - spec/big_brother/cluster_factory_spec.rb
278
286
  - spec/big_brother/cluster_spec.rb
279
287
  - spec/big_brother/configuration_spec.rb
280
288
  - spec/big_brother/health_fetcher_spec.rb
@@ -307,27 +315,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
315
  - - ! '>='
308
316
  - !ruby/object:Gem::Version
309
317
  version: '0'
310
- segments:
311
- - 0
312
- hash: 581258049934158314
313
318
  required_rubygems_version: !ruby/object:Gem::Requirement
314
319
  none: false
315
320
  requirements:
316
321
  - - ! '>='
317
322
  - !ruby/object:Gem::Version
318
323
  version: '0'
319
- segments:
320
- - 0
321
- hash: 581258049934158314
322
324
  requirements: []
323
325
  rubyforge_project:
324
- rubygems_version: 1.8.24
326
+ rubygems_version: 1.8.23
325
327
  signing_key:
326
328
  specification_version: 3
327
329
  summary: Process to monitor and update weights for servers in an IPVS pool
328
330
  test_files:
331
+ - spec/big_brother/active_active_cluster_spec.rb
332
+ - spec/big_brother/active_passive_cluster_spec.rb
329
333
  - spec/big_brother/app_spec.rb
330
334
  - spec/big_brother/cluster_collection_spec.rb
335
+ - spec/big_brother/cluster_factory_spec.rb
331
336
  - spec/big_brother/cluster_spec.rb
332
337
  - spec/big_brother/configuration_spec.rb
333
338
  - spec/big_brother/health_fetcher_spec.rb