@cryptotaxi247 / netdata-1 / commits / 57501490a

fix typo

Wing924 committed Mar 19, 2018 at 12:21 UTC 57501490a49c7206cac3a7c16af0a57a70253c42
2 files changed +16 -16
conf.d/python.d/web_log.conf
+1 -1
@@ -85,7 +85,7 @@
85 # custom_log_format: # define a custom log format
86 # pattern: '(?P<address>[\da-f.:]+) -.*?"(?P<method>[A-Z]+) (?P<url>.*?)" (?P<code>[1-9]\d{2}) (?P<bytes_sent>\d+) (?P<resp_length>\d+) (?P<resp_time>\d+\.\d+) '
87 # time_multiplier: 1000000 # type <int> - convert time to microseconds
88 -# histgram: [1,3,10,30,100, ...] # type list of int - Cumulative histogram of response time in milli seconds
88 +# histogram: [1,3,10,30,100, ...] # type list of int - Cumulative histogram of response time in milli seconds
89
90 # ----------------------------------------------------------------------
91 # WEB SERVER CONFIGURATION
python.d/web_log.chart.py
+15 -15
@@ -58,7 +58,7 @@ CHARTS_WEB = {
58 ['resp_time_avg', 'avg', 'incremental', 1, 1000]
59 ]},
60 'response_time_hist': {
61 - 'options': [None, 'Processing Time Histgram', 'requests/s', 'timings', 'web_log.response_time_hist', 'line'],
61 + 'options': [None, 'Processing Time Histogram', 'requests/s', 'timings', 'web_log.response_time_hist', 'line'],
62 'lines': [
63 ]},
64 'response_time_upstream': {
@@ -70,7 +70,7 @@ CHARTS_WEB = {
70 ['resp_time_upstream_avg', 'avg', 'incremental', 1, 1000]
71 ]},
72 'response_time_upstream_hist': {
73 - 'options': [None, 'Processing Time Histgram', 'requests/s', 'timings',
73 + 'options': [None, 'Processing Time Histogram', 'requests/s', 'timings',
74 'web_log.response_time_upstream_hist', 'line'],
75 'lines': [
76 ]},
@@ -364,24 +364,24 @@ class Web:
364 self.order.remove('response_time_upstream_hist')
365
366 # Add 'response_time_hist' and 'response_time_upstream_hist' charts if is specified in the configuration
367 - histgram = self.configuration.get('histgram', None)
368 - if type(histgram) is list:
369 - self.storage['bucket_index'] = histgram[:]
367 + histogram = self.configuration.get('histogram', None)
368 + if type(histogram) is list:
369 + self.storage['bucket_index'] = histogram[:]
370 self.storage['bucket_index'].append(sys.maxint)
371 - self.storage['buckets'] = [0] * (len(histgram) + 1)
372 - self.storage['upstream_buckets'] = [0] * (len(histgram) + 1)
371 + self.storage['buckets'] = [0] * (len(histogram) + 1)
372 + self.storage['upstream_buckets'] = [0] * (len(histogram) + 1)
373 hist_lines = self.definitions['response_time_hist']['lines']
374 upstream_hist_lines = self.definitions['response_time_upstream_hist']['lines']
375 - for i, le in enumerate(histgram):
375 + for i, le in enumerate(histogram):
376 hist_key = "response_time_hist_%d" % i
377 upstream_hist_key = "response_time_upstream_hist_%d" % i
378 hist_lines.append([hist_key, str(le), 'incremental', 1, 1])
379 upstream_hist_lines.append([upstream_hist_key, str(le), 'incremental', 1, 1])
380
381 - hist_lines.append(["response_time_hist_%d" % len(histgram), '+Inf', 'incremental', 1, 1])
382 - upstream_hist_lines.append(["response_time_upstream_hist_%d" % len(histgram), '+Inf', 'incremental', 1, 1])
383 - elif histgram is not None:
384 - self.error("expect histgram list, but was {}".format(type(histgram)))
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)))
385
386 if not self.configuration.get('all_time', True):
387 self.order.remove('clients_all')
@@ -494,7 +494,7 @@ class Web:
494 self.data[elem + '_avg'] += timings[elem]['summary'] / timings[elem]['count']
495 self.data[elem + '_max'] += timings[elem]['maximum']
496
497 - # histgram
497 + # histogram
498 if 'bucket_index' in self.storage:
499 buckets = self.storage['buckets']
500 upstream_buckets = self.storage['upstream_buckets']
@@ -953,8 +953,8 @@ def get_timings(timings, time):
953
954 def get_hist(index, buckets, time):
955 """
956 - :param index: histgram index (Ex. [10, 50, 100, 150, ...])
957 - :param buckets: histgram buckets
956 + :param index: histogram index (Ex. [10, 50, 100, 150, ...])
957 + :param buckets: histogram buckets
958 :param time: time
959 :return: None
960 """