]> arthur.barton.de Git - netdata.git/blobdiff - python.d/nginx_log.chart.py
better dimension names in nginx_log module
[netdata.git] / python.d / nginx_log.chart.py
index ea9f10b741814689011157e13f89d148cc4e4ed4..95fb123d2ffe03487d5ecb78880a115864ea17e6 100644 (file)
@@ -14,10 +14,10 @@ CHARTS = {
     'codes': {
         'options': [None, 'nginx status codes', 'requests/s', 'requests', 'nginx_log.codes', 'stacked'],
         'lines': [
-            ["20X", None, "incremental"],
-            ["30X", None, "incremental"],
-            ["40X", None, "incremental"],
-            ["50X", None, "incremental"]
+            ["2xx", None, "incremental"],
+            ["3xx", None, "incremental"],
+            ["4xx", None, "incremental"],
+            ["5xx", None, "incremental"]
         ]}
 }
 
@@ -38,10 +38,10 @@ class Service(LogService):
         Parse new log lines
         :return: dict
         """
-        data = {'20X': 0,
-                '30X': 0,
-                '40X': 0,
-                '50X': 0}
+        data = {'2xx': 0,
+                '3xx': 0,
+                '4xx': 0,
+                '5xx': 0}
         try:
             raw = self._get_raw_data()
             if raw is None:
@@ -57,13 +57,13 @@ class Service(LogService):
             beginning = code.group(1)[0]
 
             if beginning == '2':
-                data["20X"] += 1
+                data["2xx"] += 1
             elif beginning == '3':
-                data["30X"] += 1
+                data["3xx"] += 1
             elif beginning == '4':
-                data["40X"] += 1
+                data["4xx"] += 1
             elif beginning == '5':
-                data["50X"] += 1
+                data["5xx"] += 1
 
         return data