fix style
Wing924 committed
Mar 19, 2018 at 15:00 UTC
e7af848ae8b001022ede2857f826851990694e7c
1 file changed
+3
-3
python.d/web_log.chart.py
+3
-3
@@ -365,7 +365,7 @@ class Web:
365
366
# Add 'response_time_hist' and 'response_time_upstream_hist' charts if is specified in the configuration
367
histogram = self.configuration.get('histogram', None)
368
- if type(histogram) is list:
368
+ if isinstance(histogram, list):
369
self.storage['bucket_index'] = histogram[:]
370
self.storage['bucket_index'].append(sys.maxint)
371
self.storage['buckets'] = [0] * (len(histogram) + 1)
@@ -381,7 +381,7 @@ class Web:
381
hist_lines.append(["response_time_hist_%d" % len(histogram), '+Inf', 'incremental', 1, 1])
382
upstream_hist_lines.append(["response_time_upstream_hist_%d" % len(histogram), '+Inf', 'incremental', 1, 1])
383
elif histogram is not None:
384
- self.error("expect histogram list, but was {}".format(type(histogram)))
384
+ self.error("expect histogram list, but was {0}".format(type(histogram)))
385
386
if not self.configuration.get('all_time', True):
387
self.order.remove('clients_all')
@@ -958,7 +958,7 @@ def get_hist(index, buckets, time):
958
:param time: time
959
:return: None
960
"""
961
- for i in xrange(len(index)-1, -1, -1):
961
+ for i in range(len(index)-1, -1, -1):
962
if time <= index[i]:
963
buckets[i] += 1
964
else: