bipbip 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cee90e52bfde1b07ded79385252ea3fb7140f1ec
4
- data.tar.gz: b233c2c91114e51704a4f5b15bdf2f8516973c64
3
+ metadata.gz: 5ed1e1f9bcefb398a5f0b9a4f7ea89f7913ad25c
4
+ data.tar.gz: ffab0aa9fc587dd792a3e5d205294bc4168d86ea
5
5
  SHA512:
6
- metadata.gz: 83c2fd818b0ac61e02d1ded9f77fc23d1fc5a5b6d19cbb2e68d628d61cb9f830c1cc55bb262b8a3f1130304d8e940f704ecbd649e05f7915676694e00b62b68b
7
- data.tar.gz: da78b4ca96df1a3a78b645b576ec355faeaa99d9db51c249625fb298613c202f8e7f4ebbe66823765c9664dad5a94d630ef4d78c2cbbaeaa3e0971efc9c062f0
6
+ metadata.gz: 364e5c50fe638dd700baf3a7220ee60a8a78b9acfd728d22b773e96ef776ca54474fb8fcd414a6591e39d10b6bcbd418675cd8749680c2c9707e8d98b72e5e13
7
+ data.tar.gz: 2df0898d1a4e93e99f678802a1a74564bbfde45255e6545a41809484e01dd44be3e51ad11c8e75372a12fa84d0f44d3d134aed4c9a7d545274385c66df22b107
data/README.md CHANGED
@@ -68,7 +68,6 @@ services:
68
68
  plugin: fastcgi-php-apc
69
69
  host: localhost
70
70
  port: 9000
71
- path: /usr/local/bin/apc-status.php
72
71
  ```
73
72
 
74
73
  Include configuration
@@ -94,34 +93,10 @@ Requires the `cgi-fcgi` program (debian package: `libfcgi0ldbl`).
94
93
  #### fastcgi-php-apc
95
94
  Requires the `cgi-fcgi` program (debian package: `libfcgi0ldbl`).
96
95
 
97
- Create file `/usr/local/bin/apc-status.php` with content:
98
- ```php
99
- <?php
100
-
101
- $infoOpcode = @apc_cache_info('opcode', true);
102
- $infoUser = @apc_cache_info('user', true);
103
-
104
- echo json_encode(array(
105
- 'opcode_mem_size' => (int) $infoOpcode['mem_size'],
106
- 'user_mem_size' => (int) $infoUser['mem_size'],
107
- ));
108
- ```
109
-
110
96
  #### php-apc
111
97
  To collect `APC` stats of your apache process, please install the following script.
112
98
 
113
- Create file `/usr/local/bin/apc-status.php` with content:
114
- ```php
115
- <?php
116
-
117
- $infoOpcode = @apc_cache_info('opcode', true);
118
- $infoUser = @apc_cache_info('user', true);
119
-
120
- echo json_encode(array(
121
- 'opcode_mem_size' => (int) $infoOpcode['mem_size'],
122
- 'user_mem_size' => (int) $infoUser['mem_size'],
123
- ));
124
- ```
99
+ Create file `/usr/local/bin/apc-status.php` with content of `data/apc-status.php`.
125
100
 
126
101
  Create apache config `/etc/apache2/conf.d/apc-status` with content:
127
102
  ```
@@ -130,7 +105,7 @@ Alias /apc-status /usr/local/bin/apc-status.php
130
105
  <Files "/usr/local/bin/apc-status.php">
131
106
  Order deny,allow
132
107
  Deny from all
133
- Allow from all
108
+ Allow from 127.0.0.1
134
109
  </Files>
135
110
  ```
136
111
 
@@ -0,0 +1,9 @@
1
+ <?php
2
+
3
+ $infoOpcode = @apc_cache_info('opcode', true);
4
+ $infoUser = @apc_cache_info('user', true);
5
+
6
+ echo json_encode(array(
7
+ 'opcode_mem_size' => (int) $infoOpcode['mem_size'],
8
+ 'user_mem_size' => (int) $infoUser['mem_size'],
9
+ ));
data/lib/bipbip/helper.rb CHANGED
@@ -7,4 +7,8 @@ module Bipbip::Helper
7
7
  def self.name_to_filename(name)
8
8
  name.tr('-', '_')
9
9
  end
10
+
11
+ def self.data_path
12
+ File.expand_path('../../../data', __FILE__)
13
+ end
10
14
  end
@@ -11,7 +11,7 @@ module Bipbip
11
11
 
12
12
  def monitor
13
13
  authority = config['host'].to_s + ':' + config['port'].to_s
14
- path = config['path'].to_s
14
+ path = File.join(Bipbip::Helper.data_path, 'apc-status.php')
15
15
 
16
16
  env_backup = ENV.to_hash
17
17
  ENV['REQUEST_METHOD'] = 'GET'
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
@@ -136,6 +136,7 @@ files:
136
136
  - lib/bipbip/version.rb
137
137
  - lib/bipbip.rb
138
138
  - lib/interruptible_sleep.rb
139
+ - data/apc-status.php
139
140
  homepage: https://github.com/cargomedia/bipbip
140
141
  licenses:
141
142
  - MIT