haproxy-cluster 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/haproxy_cluster/backend.rb +3 -3
- data/lib/haproxy_cluster/version.rb +1 -1
- metadata +7 -7
@@ -19,12 +19,12 @@ class HAProxyCluster
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def rolling_restartable? (enough = 80)
|
22
|
-
up_servers = @servers.
|
22
|
+
up_servers = @servers.select{ |name,server| server.ok? }
|
23
23
|
if up_servers == 0
|
24
24
|
@member.log.warn { "All servers are down; can't hurt!" }
|
25
25
|
return true
|
26
|
-
elsif Rational(up_servers,@servers.count) >= Rational(enough,100)
|
27
|
-
@member.log.
|
26
|
+
elsif Rational(up_servers.count,@servers.count) >= Rational(enough,100)
|
27
|
+
@member.log.info { "#{up_servers.count}/#{@servers.count} is at least #{enough}%, so #{name} is rolling restartable." }
|
28
28
|
return true
|
29
29
|
else
|
30
30
|
@member.log.warn { "Insufficient capacity to handle a rolling restart at this time." }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haproxy-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-08-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70188325150240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70188325150240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: test-unit
|
27
|
-
requirement: &
|
27
|
+
requirement: &70188325149360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70188325149360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: webmock
|
38
|
-
requirement: &
|
38
|
+
requirement: &70188325148860 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70188325148860
|
47
47
|
description: ! " Gem and command line tool for quickly answering questions like,
|
48
48
|
\"Can we\n survive a rolling restart?\", \"How many transactions per second am
|
49
49
|
I seeing?\",\n \"What's my session backlog?\". Intended for use within continuous
|