yabeda-puma-plugin 0.2.0 → 0.2.1
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 +4 -4
- data/lib/yabeda/puma/plugin/statistics/fetcher.rb +13 -10
- data/lib/yabeda/puma/plugin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0254def10fec3276511c89a605d243a7876631ab06ffc4131adc135e4011939
|
4
|
+
data.tar.gz: f059a562c744164c2549b8e826ea793803eff702565d564df1599669695ffa9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65fda3c0f40ef45b97c30463ec976735c134773b3da2177bf38e392867551ea1e3c057d710281fdb91e9effa1dc74d958e1d391464670100996c698e6f49aaf3
|
7
|
+
data.tar.gz: 439624ba8ec4c869a96781370d17be8ec22441d66b31b51b6b3bc42af0ba6ca0b27cb65e2496ba6b2b91bb55a2ef4d40547fce0b99a4b6bde4bbbf7dc0f425e7
|
@@ -9,24 +9,27 @@ module Yabeda
|
|
9
9
|
def self.call
|
10
10
|
control_url = Yabeda::Puma::Plugin.control_url
|
11
11
|
|
12
|
-
if control_url.start_with? "unix://"
|
12
|
+
body = if control_url.start_with? "unix://"
|
13
13
|
path = control_url.gsub("unix://", '')
|
14
|
-
|
14
|
+
Socket.unix(path, &socket_block)
|
15
15
|
elsif control_url.start_with? "tcp://"
|
16
16
|
host, port = control_url.match(/^tcp:\/\/([a-z0-9\-._~%]+):([0-9]+)/).captures
|
17
|
-
|
18
|
-
sock = Socket.tcp(host, port)
|
17
|
+
Socket.tcp(host, port, &socket_block)
|
19
18
|
else
|
20
|
-
raise ArgumentError("Unknown puma control url type #{control_url}")
|
21
|
-
end
|
22
|
-
|
23
|
-
body = sock do |socket|
|
24
|
-
socket << "GET /stats?token=#{Yabeda::Puma::Plugin.control_auth_token} HTTP/1.0\r\n\r\n"
|
25
|
-
socket.read
|
19
|
+
raise ArgumentError.new("Unknown puma control url type #{control_url}")
|
26
20
|
end
|
27
21
|
|
28
22
|
JSON.parse(body.split("\n").last)
|
29
23
|
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def self.socket_block
|
28
|
+
Proc.new do |s|
|
29
|
+
s << "GET /stats?token=#{Yabeda::Puma::Plugin.control_auth_token} HTTP/1.0\r\n\r\n"
|
30
|
+
s.read
|
31
|
+
end
|
32
|
+
end
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yabeda-puma-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salahutdinov Dmitry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yabeda
|