Commit 1684838f authored by Vincent Pelletier's avatar Vincent Pelletier

Fix failure when median is enabled and --period is not set and logs are not sorted

Replacing duration_list with an itertool.chain object breaks the API
promise that it must have an append method. This cause all accumulate calls
to fail when simultaneously:
- median tracking is enabled
- period is not set and some scaling happens (ex: there is more than 4 days
  of data)
- log lines are being fed in a non-chronological order, where later lines
  are timestamped before the time some scaling happened (ex: log line for
  day 1, then day 5, then day 1 again)
When this happens, data accumulation will fail on these later lines,
causing the report to be only partial - for example errors will be missing.
parent a174cb05
......@@ -305,7 +305,7 @@ class APDEXStats:
getattr(self, attribute) + getattr(other, attribute))
self.duration_max = max(self.duration_max, other.duration_max)
if self.enable_median:
self.duration_list = itertools.chain(self.duration_list, other.duration_list)
self.duration_list.extend(other.duration_list)
def getApdex(self):
if self.hit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment