@cryptotaxi247 / netdata-1 / commits / 8fde4bd8c

high resolution web_log timings

Costa Tsaousis (ktsaou) committed Feb 11, 2017 at 16:48 UTC 8fde4bd8c8d59766249b46fa8e50ab4e41484a10
1 file changed +5 -10
python.d/web_log.chart.py
+5 -10
@@ -39,9 +39,9 @@ CHARTS = {
39 'response_time': {
40 'options': [None, 'Processing Time', 'milliseconds', 'timings', 'web_log.response_time', 'area'],
41 'lines': [
42 - ['resp_time_min', 'min', 'absolute', 1, 1],
43 - ['resp_time_max', 'max', 'absolute', 1, 1],
44 - ['resp_time_avg', 'avg', 'absolute', 1, 1]
42 + ['resp_time_min', 'min', 'absolute', 1, 1000],
43 + ['resp_time_max', 'max', 'absolute', 1, 1000],
44 + ['resp_time_avg', 'avg', 'absolute', 1, 1000]
45 ]},
46 'clients': {
47 'options': [None, 'Current Poll Unique Client IPs', 'unique ips', 'clients', 'web_log.clients', 'stacked'],
@@ -170,7 +170,7 @@ class Service(LogService):
170 r' ([\d.]+) ')
171
172 regex_function = zip([access_apache_ext, access_nginx_ext, access_default],
173 - [lambda x: x, lambda x: x * 1000, lambda x: x],
173 + [lambda x: x, lambda x: x * 1000000, lambda x: x],
174 ['access_apache_ext', 'access_nginx_ext', 'access_default'])
175 regex_name = None
176 for regex, function, name in regex_function:
@@ -214,11 +214,6 @@ class Service(LogService):
214 ' "" "Requests Per HTTP Method" requests/s "http methods"' \
215 ' web_log.http_method stacked 2 %s\n' % (job_name, self.update_every)
216
217 - if regex_name == 'access_apache_ext':
218 - self.definitions['response_time']['lines'][0][4] = 1000
219 - self.definitions['response_time']['lines'][1][4] = 1000
220 - self.definitions['response_time']['lines'][2][4] = 1000
221 -
217 # Remove 'request_time' chart from ORDER if request_time not in logs
218 if regex_name == 'access_default':
219 self.order.remove('response_time')
@@ -322,7 +317,7 @@ class Service(LogService):
317 # timings
318 if request_time:
319 to_netdata['resp_time_min'] = request_time[0]
325 - to_netdata['resp_time_avg'] = float(request_counter['sum']) / request_counter['count']
320 + to_netdata['resp_time_avg'] = round(float(request_counter['sum']) / request_counter['count'])
321 to_netdata['resp_time_max'] = request_time[-1]
322
323 to_netdata.update(self.storage)