web_log plugin: more minor fixes
Ilya committed
May 30, 2017 at 21:08 UTC
fa43c545493f33640a4ee4c4938055ca732e6aa8
1 file changed
+6
-6
python.d/web_log.chart.py
+6
-6
@@ -117,13 +117,13 @@ CHARTS_SQUID = {
117
'options': [None, 'Elapsed Time The Transaction Busied The Cache',
118
'ms', 'timings', 'web_log.squid_duration', 'area'],
119
'lines': [
120
- ['duration_min', 'min', 'incremental'],
121
- ['duration_max', 'max', 'incremental'],
122
- ['duration_avg', 'avg', 'incremental']
120
+ ['duration_min', 'min', 'incremental', 1, 1000],
121
+ ['duration_max', 'max', 'incremental', 1, 1000],
122
+ ['duration_avg', 'avg', 'incremental', 1, 1000]
123
]},
124
'squid_bytes': {
125
'options': [None, 'Amount Of Data Delivered To The Clients',
126
- 'Kb/s', 'bandwidth', 'web_log.squid_bytes', 'line'],
126
+ 'kilobits/s', 'bandwidth', 'web_log.squid_bytes', 'area'],
127
'lines': [
128
['bytes', 'sent', 'incremental', 8, 1000]
129
]},
@@ -777,7 +777,7 @@ class Squid(Mixin):
777
r' (?P<method>[A-Z]+)'
778
r' (?P<url>[^ ]+)'
779
r' (?P<user>[^ ]+)'
780
- r' (?P<hier_code>[A-Z_]+)/[0-9.-]+'
780
+ r' (?P<hier_code>[A-Z_]+)/[\da-f.:-]+'
781
r' (?P<mime_type>[^\n]+)')
782
783
match = self.storage['regex'].search(last_line)
@@ -832,7 +832,7 @@ class Squid(Mixin):
832
self.data['unmatched'] += 1
833
834
if duration:
835
- length, duration = len(duration), map(float, duration)
835
+ length, duration = len(duration), map(lambda v: float(v) * 1000, duration)
836
self.data['duration_min'] += min(duration)
837
self.data['duration_max'] += max(duration)
838
self.data['duration_avg'] += sum(duration) / length