diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2017-09-02 11:52:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-02 11:52:23 +0300 |
commit | 05740cd2effb9f0e18fcbcbd8e9b2fe05d401e1f (patch) | |
tree | e4e2735d45df750ddf73d2ef77bff9a6b1d475d7 /python.d | |
parent | 06de36a9ecec23fa7760c3fbbbcbcab509f135ac (diff) | |
parent | 0448d8f8cd1269ce44d5ba088e37a1bf189bbe41 (diff) |
Merge pull request #2563 from l2isbad/weblog_bugfix
web_log bugfix: properly parse squid response codes
Diffstat (limited to 'python.d')
-rw-r--r-- | python.d/elasticsearch.chart.py | 8 | ||||
-rw-r--r-- | python.d/web_log.chart.py | 24 |
2 files changed, 19 insertions, 13 deletions
diff --git a/python.d/elasticsearch.chart.py b/python.d/elasticsearch.chart.py index b9976aa8f0..2e0f18c0ff 100644 --- a/python.d/elasticsearch.chart.py +++ b/python.d/elasticsearch.chart.py @@ -88,11 +88,11 @@ HEALTH_STATS = [ LATENCY = { 'query_latency': - {'total': 'query_total', - 'spent_time': 'query_time_in_millis'}, + {'total': 'indices_search_query_total', + 'spent_time': 'indices_search_query_time_in_millis'}, 'fetch_latency': - {'total': 'fetch_total', - 'spent_time': 'fetch_time_in_millis'}, + {'total': 'indices_search_fetch_total', + 'spent_time': 'indices_search_fetch_time_in_millis'}, 'indexing_latency': {'total': 'indices_indexing_index_total', 'spent_time': 'indices_indexing_index_time_in_millis'}, diff --git a/python.d/web_log.chart.py b/python.d/web_log.chart.py index efa6b2b126..a63618027a 100644 --- a/python.d/web_log.chart.py +++ b/python.d/web_log.chart.py @@ -1,17 +1,20 @@ # -*- coding: utf-8 -*- # Description: web log netdata python.d module # Author: l2isbad -import re + import bisect -from os import access, R_OK -from os.path import getsize +import re + from collections import namedtuple, defaultdict from copy import deepcopy +from os import access, R_OK +from os.path import getsize try: from itertools import filterfalse except ImportError: from itertools import ifilterfalse as filterfalse + from base import LogService import msg @@ -937,18 +940,21 @@ class Squid(Mixin): :return: """ if code not in self.data: - self.add_new_dimension(dimension_id=code, chart_key='squid_code') + self.add_new_dimension(dimension_id=code, + chart_key='squid_code') self.data[code] += 1 - if '_' not in code: - return + for tag in code.split('_'): try: chart_key = SQUID_CODES[tag] except KeyError: continue - if tag not in self.data: - self.add_new_dimension(dimension_id=tag, chart_key=chart_key) - self.data[tag] += 1 + dimension_id = '_'.join(['code_detailed', tag]) + if dimension_id not in self.data: + self.add_new_dimension(dimension_id=dimension_id, + dimension=tag, + chart_key=chart_key) + self.data[dimension_id] += 1 def get_timings(timings, time): |