yabeda-puma-plugin 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/docs/diagram.png +0 -0
- data/lib/yabeda/puma/plugin/statistics/fetcher.rb +14 -1
- data/lib/yabeda/puma/plugin/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12d2eced94a7f0365f65189ef0002ae70d555e5c9fa02a5c3a9692f6b8a8ae65
|
4
|
+
data.tar.gz: 232a6e796501204873651b557439cc6ecdd525b2688b7fbf77059e7b41431a8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f7d371011d50c329ccdd0e16da01291b07cff94da8825ea9b378c98d1d103a3a2c162b22bdff8e412c5b693b056b4d04b8c245b2b73b0e7fffeac174668ee6d
|
7
|
+
data.tar.gz: 519e7962f993e9f64d4d58a3db2c9c4bf377802c286216700d8d5b6508689afc21622e3a75ebd44ace6ae534dc1b59a0f8f465dbbabf324a191c6248b6a0a412
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<a href="https://amplifr.com/?utm_source=
|
1
|
+
<a href="https://amplifr.com/?utm_source=yabeda-puma-plugin">
|
2
2
|
<img width="100" height="140" align="right"
|
3
3
|
alt="Sponsored by Amplifr" src="https://amplifr-direct.s3-eu-west-1.amazonaws.com/social_images/image/37b580d9-3668-4005-8d5a-137de3a3e77c.png" />
|
4
4
|
</a>
|
@@ -14,7 +14,7 @@ Works as the Puma plugin and provides following metrics:
|
|
14
14
|
- `puma_booted_workers` - the number of booted puma workers
|
15
15
|
- `puma_old_workers` - the number of old puma worker
|
16
16
|
|
17
|
-
Segmented by the worker:
|
17
|
+
Segmented by the worker (index of the worker):
|
18
18
|
- `puma_pool_capacity` - the capacity of each worker: the number of requests that the server is capable of taking right now. More details are [here](https://github.com/puma/puma/blob/0f8b10737e36fc24cdd572f76a739659b5fad9cb/lib/puma/server.rb#L167).
|
19
19
|
- `puma_running` - the number of running threads (spawned threads) for any puma worker
|
20
20
|
- `puma_max_threads` - preconfigured maximum number of worker threads
|
@@ -25,7 +25,7 @@ Segmented by the worker:
|
|
25
25
|
Add this line to your application's Gemfile:
|
26
26
|
|
27
27
|
```ruby
|
28
|
-
gem 'yabeda-puma'
|
28
|
+
gem 'yabeda-puma-plugin'
|
29
29
|
```
|
30
30
|
|
31
31
|
And then execute:
|
@@ -84,7 +84,7 @@ docker-compose run app bundle exec rspec
|
|
84
84
|
|
85
85
|
## Contributing
|
86
86
|
|
87
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
87
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yabeda-rb/yabeda-puma-plugin.
|
88
88
|
|
89
89
|
## License
|
90
90
|
|
data/docs/diagram.png
CHANGED
Binary file
|
@@ -7,7 +7,20 @@ module Yabeda
|
|
7
7
|
module Statistics
|
8
8
|
class Fetcher
|
9
9
|
def self.call
|
10
|
-
|
10
|
+
control_url = Yabeda::Puma::Plugin.control_url
|
11
|
+
|
12
|
+
if control_url.start_with? "unix://"
|
13
|
+
path = control_url.gsub("unix://", '')
|
14
|
+
sock = Socket.unix(path)
|
15
|
+
elsif control_url.start_with? "tcp://"
|
16
|
+
host, port = control_url.match(/^tcp:\/\/([a-z0-9\-._~%]+):([0-9]+)/).captures
|
17
|
+
|
18
|
+
sock = Socket.tcp(host, port)
|
19
|
+
else
|
20
|
+
raise ArgumentError("Unknown puma control url type #{control_url}")
|
21
|
+
end
|
22
|
+
|
23
|
+
body = sock do |socket|
|
11
24
|
socket << "GET /stats?token=#{Yabeda::Puma::Plugin.control_auth_token} HTTP/1.0\r\n\r\n"
|
12
25
|
socket.read
|
13
26
|
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.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2019-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yabeda
|
@@ -154,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
|
158
|
-
rubygems_version: 2.7.7
|
157
|
+
rubygems_version: 3.0.3
|
159
158
|
signing_key:
|
160
159
|
specification_version: 4
|
161
160
|
summary: Puma web server plugin for collecting puma metrics with Yabeda framework.
|