def find_timestamp_range()

in uberpoet/cpulogger.py [0:0]


    def find_timestamp_range(traces):
        """
        Finds the minimum and maximum times of items inside a chrome trace list,
        so the CPU log won't add CPU items outside of it's range.
        """
        min_ts = sys.maxsize
        max_ts = -1
        for trace in traces:
            ts = trace['ts']
            if ts < min_ts:
                min_ts = ts
            elif ts > max_ts:
                max_ts = ts
        return min_ts, max_ts