summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorIlya <ilyamaschenko@gmail.com>2017-07-23 16:57:43 +0900
committerIlya <ilyamaschenko@gmail.com>2017-07-23 16:57:43 +0900
commitd2b18d35f4341410e918dbce3fd8290956b6220b (patch)
tree9c960037b71e9e2183e9929f909c96fbe87e8a13 /python.d
parent57ada03b8dddd80ac571ce67a9f69921dcfccea7 (diff)
web_log plugin: "all_time" option added for squid
Diffstat (limited to 'python.d')
-rw-r--r--python.d/web_log.chart.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python.d/web_log.chart.py b/python.d/web_log.chart.py
index 18670a73de..1f47eb3bd4 100644
--- a/python.d/web_log.chart.py
+++ b/python.d/web_log.chart.py
@@ -853,6 +853,8 @@ class Squid(Mixin):
'chart': 'squid_mime_type',
'func_dim_id': lambda v: v.split('/')[0],
'func_dim': None}}
+ if not self.conf.get('all_time', True):
+ self.order.remove('squid_clients_all')
return True
def get_data(self, raw_data=None):
@@ -883,10 +885,11 @@ class Squid(Mixin):
proto = 'ipv4' if '.' in match['client_address'] else 'ipv6'
# unique clients ips
- if address_not_in_pool(pool=self.storage['unique_all_time'],
- address=match['client_address'],
- pool_size=self.data['unique_tot_ipv4'] + self.data['unique_tot_ipv6']):
- self.data['unique_tot_' + proto] += 1
+ if self.conf.get('all_time', True):
+ if address_not_in_pool(pool=self.storage['unique_all_time'],
+ address=match['client_address'],
+ pool_size=self.data['unique_tot_ipv4'] + self.data['unique_tot_ipv6']):
+ self.data['unique_tot_' + proto] += 1
if match['client_address'] not in unique_ip:
self.data['unique_' + proto] += 1