@cryptotaxi247 / netdata-1 / commits / 4a93fdee3

web_log plugin: PerUrlReq chart dimensions must be unique

Ilya committed Feb 16, 2017 at 13:05 UTC 4a93fdee3aa62f672be6179fd0b3b9b21222b8a1
1 file changed +5 -5
python.d/web_log.chart.py
+5 -5
@@ -400,12 +400,12 @@ class Service(LogService):
400 if self.url_pattern:
401 self.definitions['requests_per_url'] = {'options': [None, 'Requests Per Url', 'requests/s',
402 'urls', 'web_log.requests_per_url', 'stacked'],
403 - 'lines': [['other_url', 'other', 'incremental']]}
403 + 'lines': [['pur_other', 'other', 'incremental']]}
404 for elem in self.url_pattern:
405 - self.definitions['requests_per_url']['lines'].append([elem.description, elem.description,
405 + self.definitions['requests_per_url']['lines'].append([elem.description, elem.description[4:],
406 'incremental'])
407 self.data.update({elem.description: 0})
408 - self.data.update({'other_url': 0})
408 + self.data.update({'pur_other': 0})
409 else:
410 self.order.remove('requests_per_url')
411
@@ -529,7 +529,7 @@ class Service(LogService):
529 match = True
530 break
531 if not match:
532 - self.data['other_url'] += 1
532 + self.data['pur_other'] += 1
533
534 def _get_data_statuses(self, code):
535 """
@@ -607,7 +607,7 @@ def check_req_per_url_pattern(url_pattern):
607 for dimension, regex in url_pattern.items():
608 valid_pattern = is_valid_pattern(regex)
609 if isinstance(dimension, str) and valid_pattern:
610 - result.append(NAMED_URL_PATTERN(description=dimension, pattern=valid_pattern))
610 + result.append(NAMED_URL_PATTERN(description='_'.join(['pur', dimension]), pattern=valid_pattern))
611
612 return result or None
613