litmus_paper 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ab0a2d2bdf985757966671d62f5394d050cf23
|
4
|
+
data.tar.gz: 783dd54f751a15260583508c38d4cfb1cf67c8ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f0188ded625a2605a3da4bba95866517469f713400ff38372c1ffbd26924e2c356af26067207719383fa48562da7605004a452b2a1add0cb486afa96e7b03b7
|
7
|
+
data.tar.gz: 62e49cdad532162054aa364acb84af933c5d4254f54eccb638f32283244e1973c42e2212ef6043ba6780f1c64167f597b8e518f552fed7550ffca9b4ef1187bc
|
@@ -7,17 +7,21 @@ module LitmusPaper
|
|
7
7
|
@weight = weight
|
8
8
|
@socket_path = socket_path
|
9
9
|
@maxconn = maxconn
|
10
|
+
@active = 0
|
11
|
+
@queued = 0
|
10
12
|
end
|
11
13
|
|
12
14
|
def current_health
|
13
15
|
stats = _stats
|
14
|
-
|
16
|
+
@active = stats.active
|
17
|
+
@queued = stats.queued
|
18
|
+
if @queued == 0
|
15
19
|
return @weight
|
16
20
|
else
|
17
21
|
return [
|
18
22
|
@weight - (
|
19
|
-
(@weight *
|
20
|
-
(2 * @weight *
|
23
|
+
(@weight * @active.to_f) / (3 * @maxconn.to_f) +
|
24
|
+
(2 * @weight * @queued.to_f) / (3 * @maxconn.to_f)
|
21
25
|
), 1
|
22
26
|
].max
|
23
27
|
end
|
@@ -28,7 +32,7 @@ module LitmusPaper
|
|
28
32
|
end
|
29
33
|
|
30
34
|
def to_s
|
31
|
-
"Metric::UnixSocketUtilitization(weight: #{@weight}, maxconn: #{@maxconn}, path: #{@socket_path})"
|
35
|
+
"Metric::UnixSocketUtilitization(weight: #{@weight}, maxconn: #{@maxconn}, active: #{@active.to_i}, queued: #{@queued.to_i}, path: #{@socket_path})"
|
32
36
|
end
|
33
37
|
end
|
34
38
|
end
|
data/lib/litmus_paper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: litmus_paper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Braintreeps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|