"phpfpm" module update
lgz committed
Oct 14, 2017 at 22:06 UTC
2677b57599de86d59f90ef743f020be3c81f9c6f
1 file changed
+5
-4
python.d/phpfpm.chart.py
+5
-4
@@ -2,10 +2,11 @@
2
# Description: PHP-FPM netdata python.d module
3
# Author: Pawel Krupa (paulfantom)
4
5
-from base import UrlService
5
import json
6
import re
7
8
+from bases.FrameworkServices.UrlService import UrlService
9
+
10
# default module values (can be overridden per job in `config`)
11
# update_every = 2
12
priority = 60000
@@ -40,6 +41,7 @@ PER_PROCESS_INFO = [
41
def average(collection):
42
return sum(collection, 0.0) / max(len(collection), 1)
43
44
+
45
CALC = [
46
('min', min),
47
('max', max),
@@ -130,8 +132,8 @@ class Service(UrlService):
132
133
if p_info:
134
for new_name in PER_PROCESS_INFO:
133
- for name, function in CALC:
134
- to_netdata[name + new_name[1]] = function([p_info[k] for k in p_info if new_name[1] in k])
135
+ for name, func in CALC:
136
+ to_netdata[name + new_name[1]] = func([p_info[k] for k in p_info if new_name[1] in k])
137
138
return to_netdata or None
139
@@ -165,4 +167,3 @@ def parse_raw_data_(is_json, regex, raw_data):
167
else:
168
raw_data = ' '.join(raw_data.split())
169
return dict(regex.findall(raw_data))
168
-