ring-sqa 0.2.2 → 0.3.0

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: 575a1fe95c4b6aeef9d1469fbbd3ad738bb3df11
4
- data.tar.gz: 983918acc69c27d86ec309245aaaa6bab7ae2892
3
+ metadata.gz: e6ef7e3d5abcf18e06a41d47d2f3bed0f0c81875
4
+ data.tar.gz: 3d9955866b2ff105f155e472fbff97c664d8b865
5
5
  SHA512:
6
- metadata.gz: 33866954ec631f08093ac610f2f0069208a27fae7f643156eb5dce998d966e7eb8f7ecce4332508ffc43a09c268f93a484edf19401a49a6da5e8ac173864eacd
7
- data.tar.gz: d10307beb8fcf195df725eaa6a280e16b49a4d0adb92cabc64d28b039cdb2ea44704fe254dc824a400d2be06cd6ff4812a18912cbb7de5d35c89b566812dc2c3
6
+ metadata.gz: 923771057e38033054fa3b82b67755798beab1b6399de91ca85192af1d188d2f5d7a3a3a005d0e4e0cd9c1d2c843f772be1ee30f9ce07e6fb4b62805f9c28740
7
+ data.tar.gz: 0837e7fa36e9c347cf6644a01627c8eb3386bb11d4deb8dabb14cfaa2c291fc668a427737565e7cffbe0976127ade1d794903755e792a27a5df50585c8ff958b
@@ -28,7 +28,7 @@ An alarm is raised under the following conditions: every 30 seconds
28
28
  your node pings all other nodes. The amount of nodes that cannot be
29
29
  reached is stored in a circular buffer, with each element representing
30
30
  a minute of measurements. In the event that the last three minutes are
31
- #{Ring::SQA::CFG.analyzer.tolerance} above the median of the previous #{Ring::SQA::CFG.analyzer.median_of} measurement slots, a partial
31
+ #{Ring::SQA::CFG.analyzer.tolerance.relative} above the median of the previous #{Ring::SQA::CFG.analyzer.median_of} measurement slots, a partial
32
32
  outage is assumed. The ring buffer's output is as following:
33
33
 
34
34
  #{buffer_list}
@@ -68,8 +68,9 @@ class SQA
68
68
  node_count[0..last].sort[last/2]
69
69
  end
70
70
  def exceed_median? tolerance=CFG.analyzer.tolerance
71
- violate = (median+1)*tolerance
72
- node_count[@median_of..-1].all? { |e| e > violate }
71
+ violate_relative = (median+1)*tolerance.relative
72
+ violate_absolute = (median+1)+tolerance.absolute
73
+ node_count[@median_of..-1].all? { |e| e > violate_relative && e > violate_absolute }
73
74
  end
74
75
  def node_count
75
76
  @array.map { |nodes| nodes.size }
@@ -12,7 +12,8 @@ module Ring
12
12
  Config.default.directory = Directory
13
13
  Config.default.debug = false
14
14
  Config.default.port = 'ring'.to_i(36)/100
15
- Config.default.analyzer.tolerance = 1.2
15
+ Config.default.analyzer.tolerance.relative = 1.2
16
+ Config.default.analyzer.tolerance.absolute = 10
16
17
  Config.default.analyzer.size = 30
17
18
  Config.default.analyzer.median_of = 27
18
19
  Config.default.nodes_json = '/etc/ring/nodes.json'
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ring-sqa'
3
- s.version = '0.2.2'
3
+ s.version = '0.3.0'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti', 'Job Snijders' ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ring-sqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-22 00:00:00.000000000 Z
12
+ date: 2016-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: slop