@cryptotaxi247 / netdata-1 / commits / 8271b0e06

better dimension names in nginx_log module

paulfantom committed Aug 16, 2016 at 20:57 UTC 8271b0e0603c6fdd06ce9e1aaf988f173984d5cc
1 file changed +12 -12
python.d/nginx_log.chart.py
+12 -12
@@ -14,10 +14,10 @@ CHARTS = {
14 'codes': {
15 'options': [None, 'nginx status codes', 'requests/s', 'requests', 'nginx_log.codes', 'stacked'],
16 'lines': [
17 - ["20X", None, "incremental"],
18 - ["30X", None, "incremental"],
19 - ["40X", None, "incremental"],
20 - ["50X", None, "incremental"]
17 + ["2xx", None, "incremental"],
18 + ["3xx", None, "incremental"],
19 + ["4xx", None, "incremental"],
20 + ["5xx", None, "incremental"]
21 ]}
22 }
23
@@ -38,10 +38,10 @@ class Service(LogService):
38 Parse new log lines
39 :return: dict
40 """
41 - data = {'20X': 0,
42 - '30X': 0,
43 - '40X': 0,
44 - '50X': 0}
41 + data = {'2xx': 0,
42 + '3xx': 0,
43 + '4xx': 0,
44 + '5xx': 0}
45 try:
46 raw = self._get_raw_data()
47 if raw is None:
@@ -57,13 +57,13 @@ class Service(LogService):
57 beginning = code.group(1)[0]
58
59 if beginning == '2':
60 - data["20X"] += 1
60 + data["2xx"] += 1
61 elif beginning == '3':
62 - data["30X"] += 1
62 + data["3xx"] += 1
63 elif beginning == '4':
64 - data["40X"] += 1
64 + data["4xx"] += 1
65 elif beginning == '5':
66 - data["50X"] += 1
66 + data["5xx"] += 1
67
68 return data
69