bipbip 0.2.2 → 0.2.3
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/README.md +6 -1
- data/lib/bipbip.rb +1 -0
- data/lib/bipbip/plugin/php_fpm.rb +13 -4
- data/lib/bipbip/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: e4f44ff5a912f62505175131fc84b775583b58f1
|
|
4
|
+
data.tar.gz: 944a75282d428af5e347fc08a3cc8812a8db2ef9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21e998fc4160e95dbc1222b50bfdcd337f7041dfcf37ad651f25ce6de3633902c894d88c3d55be23dfb47c69729d3c5b22f1eeb94a44baaf350d7ec292988896
|
|
7
|
+
data.tar.gz: 2dd70820ae7dcb8b2760ee33c2a6762031ed1a7a912f8ca5c8a49c33dd70aa215d8c9bb50c6a9a948903aa82e7dc8a65f47f0ca1aba1809e62349aec3c46b7e9
|
data/README.md
CHANGED
|
@@ -56,7 +56,9 @@ services:
|
|
|
56
56
|
url: http://localhost:80/server-status
|
|
57
57
|
-
|
|
58
58
|
plugin: php-fpm
|
|
59
|
-
|
|
59
|
+
host: localhost
|
|
60
|
+
port: 9000
|
|
61
|
+
path: /fpm-status
|
|
60
62
|
-
|
|
61
63
|
plugin: network
|
|
62
64
|
-
|
|
@@ -81,6 +83,9 @@ port: 11211
|
|
|
81
83
|
|
|
82
84
|
Plugins
|
|
83
85
|
----------------------------
|
|
86
|
+
#### php-fpm
|
|
87
|
+
Requires the `cgi-fcgi` program (debian package: `libfcgi0ldbl`).
|
|
88
|
+
|
|
84
89
|
#### php-apc
|
|
85
90
|
To collect `APC` stats of your apache process, please install the following script.
|
|
86
91
|
|
data/lib/bipbip.rb
CHANGED
|
@@ -11,11 +11,20 @@ module Bipbip
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def monitor
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
raise "Invalid response from server at #{config['url']}" unless response.code == '200'
|
|
14
|
+
authority = config['host'].to_s + ':' + config['port'].to_s
|
|
15
|
+
path = config['path'].to_s
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
env_backup = ENV.to_hash
|
|
18
|
+
ENV['REQUEST_METHOD'] = 'GET'
|
|
19
|
+
ENV['SCRIPT_NAME'] = path
|
|
20
|
+
ENV['SCRIPT_FILENAME'] = path
|
|
21
|
+
ENV['QUERY_STRING'] = 'json'
|
|
22
|
+
response = `cgi-fcgi -bind -connect #{authority.shellescape} 2>&1`
|
|
23
|
+
ENV.replace(env_backup)
|
|
24
|
+
|
|
25
|
+
body = response.split(/\r?\n\r?\n/)[1]
|
|
26
|
+
raise "FastCGI response has no body: #{response}" unless body
|
|
27
|
+
status = JSON.parse(body)
|
|
19
28
|
|
|
20
29
|
status.reject{|k, v| !metrics_names.include?(k)}
|
|
21
30
|
end
|
data/lib/bipbip/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bipbip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cargo Media
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-12-
|
|
11
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: copperegg
|