aboutsummaryrefslogtreecommitdiff
path: root/cros_utils/timeline.py
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-12-23 16:56:26 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-09 07:34:17 +0000
commit45e4c1f8be303b43030e3dfac6cab5cd67d10a99 (patch)
treef00931a3bf505fded2f375f7589b41e6dfc34f18 /cros_utils/timeline.py
parente41baa8073f6f5d160ef8cf75ccb7ca9beb1ad72 (diff)
downloadtoolchain-utils-45e4c1f8be303b43030e3dfac6cab5cd67d10a99.tar.gz
toolchain-utils: Migrate cros_utils to python3
This patch fixes all presubmit checks in cros_utils and migrated it from python2 to python3. TEST=Passed all unittests and presubmit checks. BUG=chromium:1011676 Change-Id: I3a7097d6570fb2cb4e5dcdd5ae22f30c5c5762e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1981087 Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com> Auto-Submit: Zhizhou Yang <zhizhouy@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'cros_utils/timeline.py')
-rw-r--r--cros_utils/timeline.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/cros_utils/timeline.py b/cros_utils/timeline.py
index 873aaa30..cce0b05c 100644
--- a/cros_utils/timeline.py
+++ b/cros_utils/timeline.py
@@ -1,5 +1,8 @@
-# Copyright 2012 Google Inc. All Rights Reserved.
-#
+# -*- coding: utf-8 -*-
+# Copyright 2019 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
"""Tools for recording and reporting timeline of benchmark_run."""
from __future__ import print_function
@@ -25,8 +28,8 @@ class Timeline(object):
def Record(self, event):
for e in self.events:
- assert e.name != event, ('The event {0} is already recorded.'
- .format(event))
+ assert e.name != event, (
+ 'The event {0} is already recorded.'.format(event))
cur_event = Event(name=event, cur_time=time.time())
self.events.append(cur_event)
@@ -43,7 +46,7 @@ class Timeline(object):
for e in self.events:
if e.name == event:
return e.timestamp
- raise IndexError, 'The event {0} is not recorded'.format(event)
+ raise IndexError('The event {0} is not recorded'.format(event))
def GetLastEventTime(self):
return self.events[-1].timestamp