web_log: py3 use sys.maxsize instead sys.maxint
lgz committed
Apr 20, 2018 at 20:07 UTC
2dc029fcf3b3660c4f682c2a49a14be49479ff5e
1 file changed
+6
-2
python.d/web_log.chart.py
+6
-2
@@ -5,7 +5,6 @@
5
import bisect
6
import re
7
import os
8
-import sys
8
9
from collections import namedtuple, defaultdict
10
from copy import deepcopy
@@ -16,6 +15,11 @@ except ImportError:
15
from itertools import ifilter as filter
16
from itertools import ifilterfalse as filterfalse
17
18
+try:
19
+ from sys import maxint
20
+except ImportError:
21
+ from sys import maxsize as maxint
22
+
23
from bases.collection import read_last_line
24
from bases.FrameworkServices.LogService import LogService
25
@@ -367,7 +371,7 @@ class Web:
371
histogram = self.configuration.get('histogram', None)
372
if isinstance(histogram, list):
373
self.storage['bucket_index'] = histogram[:]
370
- self.storage['bucket_index'].append(sys.maxint)
374
+ self.storage['bucket_index'].append(maxint)
375
self.storage['buckets'] = [0] * (len(histogram) + 1)
376
self.storage['upstream_buckets'] = [0] * (len(histogram) + 1)
377
hist_lines = self.definitions['response_time_hist']['lines']