beanpool 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/beanpool.rb +2 -2
- data/lib/beanpool/connections.rb +17 -0
- data/lib/beanpool/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be9c997d937fe769d9be68925d185528015bde8
|
4
|
+
data.tar.gz: af21307cde08fb39b73f2998ec524ddc7c069824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73b2fc7bacf31885e5d101187a77d3c3824153a17a8e5166ab9d849f4001bbbbe917c21ad000f1095f8e2dc87e5d83028b1b48b0e9b4be18492898e71c290491
|
7
|
+
data.tar.gz: 073383c828ceb4e01939efdc708f17bfb1e3798f8a727ffe4aa191a1b4236fc520c8ceb62fd7e92f881ec207df35b42a79739b36f60543125f88cf5fed5f9be7
|
data/lib/beanpool.rb
CHANGED
data/lib/beanpool/connections.rb
CHANGED
@@ -131,6 +131,23 @@ class Beanpool
|
|
131
131
|
new_hash
|
132
132
|
end
|
133
133
|
|
134
|
+
def all_stats(tube_name)
|
135
|
+
return_struct = {}
|
136
|
+
@connections.each do |ip, connection|
|
137
|
+
stat = connection.tubes[tube_name].stats
|
138
|
+
stat.to_h.each do |name, val|
|
139
|
+
return_struct[name] = if val.is_a?(Integer)
|
140
|
+
return_struct[name].nil? ? val.to_i : return_struct[name] + val.to_i
|
141
|
+
elsif name == "name"
|
142
|
+
return_struct[name].nil? ? ip.to_s : return_struct[name] + "|" + ip.to_s
|
143
|
+
else
|
144
|
+
return_struct[name].nil? ? val.to_s : return_struct[name] + "|" + val.to_s
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
return return_struct
|
149
|
+
end
|
150
|
+
|
134
151
|
def stats(tube_name, stat_name)
|
135
152
|
value = 0
|
136
153
|
@connections.each do |_k, v|
|
data/lib/beanpool/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beanpool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason M.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|