def GetTimeframe(self, time_key, is_iso_time=True): """Return a pair of min / max values found for the given time_key across all test runs. 'time_key' -- Annotation key referring to a string convertible to either iso-formatted time or floating point number. returns -- minimum, maximum.""" minimum = None maximum = None for r in self.GetAllRuns(): time_string = r.GetAnnotation(time_key) if not time_string: continue if is_iso_time: time = parse_time_iso(time_string) else: time = float(time_string) if not minimum or minimum > time: minimum = time if not maximum or maximum < time: # Make sure the largest value is still inside the interval. maximum = time + 0.1 return minimum, maximum
def GetTimeframe(self, time_key, is_iso_time = True): """Return a pair of min / max values found for the given time_key across all test runs. 'time_key' -- Annotation key referring to a string convertible to either iso-formatted time or floating point number. returns -- minimum, maximum.""" minimum = None maximum = None for r in self.GetAllRuns(): time_string = r.GetAnnotation(time_key) if not time_string: continue if is_iso_time: time = parse_time_iso(time_string) else: time = float(time_string) if not minimum or minimum > time: minimum = time if not maximum or maximum < time: # Make sure the largest value is still inside the interval. maximum = time + 0.1 return minimum, maximum
def GetRunInTimeframe(self, key, value, time_key, minimum, maximum, is_iso_time = True): """Return a test run id matching the key and timeframe.""" for i in range(len(self.GetAllRuns())): r = self.GetAllRuns()[i] if r.GetAnnotation(key) != value: continue time_string = r.GetAnnotation(time_key) if not time_string: continue if is_iso_time: time = parse_time_iso(time_string) else: time = float(time_string) if time >= minimum and time < maximum: return i # No match. return None
def GetRunInTimeframe(self, key, value, time_key, minimum, maximum, is_iso_time=True): """Return a test run id matching the key and timeframe.""" for i in range(len(self.GetAllRuns())): r = self.GetAllRuns()[i] if r.GetAnnotation(key) != value: continue time_string = r.GetAnnotation(time_key) if not time_string: continue if is_iso_time: time = parse_time_iso(time_string) else: time = float(time_string) if time >= minimum and time < maximum: return i # No match. return None