'Extend the data fro the current StatsEntry with the stats from another
StatsEntry instance.
If full_request_history is False, we\'ll only care to add the data from
the last 20 seconds of other\'s stats. The reason for this argument is that
extend can be used to generate an aggregate of multiple different StatsEntry
instances on the fly, in order to get the *total* current RPS, average
response time, etc.'

def extend(self, other, full_request_history=False):

    self.last_request_timestamp = max(self.last_request_timestamp, other.last_request_timestamp)
    self.start_time = min(self.start_time, other.start_time)
    self.num_requests = (self.num_requests + other.num_requests)
    self.num_failures = (self.num_failures + other.num_failures)
    self.total_response_time = (self.total_response_time + other.total_response_time)
    self.max_response_time = max(self.max_response_time, other.max_response_time)
    self.min_response_time = (min((self.min_response_time or 0), (other.min_response_time or 0)) or other.min_response_time)
    self.total_content_length = (self.total_content_length + other.total_content_length)
    if full_request_history:
        for key in other.response_times:
            self.response_times[key] = (self.response_times.get(key, 0) + other.response_times[key])
        for key in other.num_reqs_per_sec:
            self.num_reqs_per_sec[key] = (self.num_reqs_per_sec.get(key, 0) + other.num_reqs_per_sec[key])
    else:
        for i in xrange((other.last_request_timestamp - 20), (other.last_request_timestamp + 1)):
            if (i in other.num_reqs_per_sec):
                self.num_reqs_per_sec[i] = (self.num_reqs_per_sec.get(i, 0) + other.num_reqs_per_sec[i])
