web_log plugin: minor fixes
Ilya committed
May 30, 2017 at 23:23 UTC
bf5df24777abe1715038303793ea13e05040c2ec
1 file changed
+12
-11
python.d/web_log.chart.py
+12
-11
@@ -37,7 +37,7 @@ CHARTS_WEB = {
37
['unmatched', None, 'incremental']
38
]},
39
'bandwidth': {
40
- 'options': [None, 'Bandwidth', 'Kb/s', 'bandwidth', 'web_log.bandwidth', 'area'],
40
+ 'options': [None, 'Bandwidth', 'kilobits/s', 'bandwidth', 'web_log.bandwidth', 'area'],
41
'lines': [
42
['resp_length', 'received', 'incremental', 8, 1000],
43
['bytes_sent', 'sent', 'incremental', -8, 1000]
@@ -115,7 +115,7 @@ CHARTS_APACHE_CACHE = {
115
CHARTS_SQUID = {
116
'squid_duration': {
117
'options': [None, 'Elapsed Time The Transaction Busied The Cache',
118
- 'ms', 'squid_timings', 'web_log.squid_duration', 'area'],
118
+ 'milliseconds', 'squid_timings', 'web_log.squid_duration', 'area'],
119
'lines': [
120
['duration_min', 'min', 'incremental', 1, 1000],
121
['duration_max', 'max', 'incremental', 1, 1000],
@@ -137,7 +137,8 @@ CHARTS_SQUID = {
137
['bad_requests', 'bad', 'incremental', 1, 1]
138
]},
139
'squid_response_codes': {
140
- 'options': [None, 'Response Codes', 'responses/s', 'squid_responses', 'web_log.squid_response_codes', 'stacked'],
140
+ 'options': [None, 'Response Codes', 'responses/s', 'squid_responses',
141
+ 'web_log.squid_response_codes', 'stacked'],
142
'lines': [
143
['2xx', None, 'incremental'],
144
['5xx', None, 'incremental'],
@@ -150,7 +151,7 @@ CHARTS_SQUID = {
151
]},
152
'squid_code': {
153
'options': [None, 'Responses Per Cache Result Of The Request',
153
- 'responses/s', 'squid_cache', 'web_log.squid_code', 'stacked'],
154
+ 'requests/s', 'squid_squid_cache', 'web_log.squid_code', 'stacked'],
155
'lines': [
156
]},
157
'squid_detailed_response_codes': {
@@ -160,7 +161,7 @@ CHARTS_SQUID = {
161
]},
162
'squid_hier_code': {
163
'options': [None, 'Responses Per Hierarchy Code',
163
- 'responses/s', 'squid_hierarchy', 'web_log.squid_hier_code', 'stacked'],
164
+ 'requests/s', 'squid_hierarchy', 'web_log.squid_hier_code', 'stacked'],
165
'lines': [
166
]},
167
'squid_method': {
@@ -183,27 +184,27 @@ CHARTS_SQUID = {
184
['unique_tot_ipv6', 'ipv6', 'absolute']
185
]},
186
'squid_transport_methods': {
186
- 'options': [None, 'Transport Methods', 'squid_methods', 'squid_transport',
187
+ 'options': [None, 'Transport Methods', 'requests/s', 'squid_squid_transport',
188
'web_log.squid_transport_methods', 'stacked'],
189
'lines': [
190
]},
191
'squid_transport_errors': {
191
- 'options': [None, 'Transport Errors', 'squid_errors', 'squid_transport',
192
+ 'options': [None, 'Transport Errors', 'requests/s', 'squid_squid_transport',
193
'web_log.squid_transport_errors', 'stacked'],
194
'lines': [
195
]},
196
'squid_handling_opts': {
196
- 'options': [None, 'Handling Opts', 'squid_errors', 'squid_cache',
197
+ 'options': [None, 'Handling Opts', 'requests/s', 'squid_squid_cache',
198
'web_log.squid_handling_opts', 'stacked'],
199
'lines': [
200
]},
201
'squid_object_types': {
201
- 'options': [None, 'Object Types', 'squid_types', 'squid_cache',
202
+ 'options': [None, 'Object Types', 'objects/s', 'squid_squid_cache',
203
'web_log.squid_object_types', 'stacked'],
204
'lines': [
205
]},
206
'squid_cache_events': {
206
- 'options': [None, 'Cache Events', 'squid_events', 'squid_cache',
207
+ 'options': [None, 'Cache Events', 'events/s', 'squid_squid_cache',
208
'web_log.squid_cache_events', 'stacked'],
209
'lines': [
210
]}
@@ -796,7 +797,7 @@ class Squid(Mixin):
797
match = self.storage['regex'].search(row)
798
if match:
799
match = match.groupdict()
799
- if 'DENIED' not in match['squid_code']:
800
+ if match['duration'] != '0':
801
duration.append(match['duration'])
802
try:
803
self.data[match['http_code'][0] + 'xx'] += 1