summaryrefslogtreecommitdiffstats
path: root/event_log.py
diff options
context:
space:
mode:
Diffstat (limited to 'event_log.py')
-rw-r--r--event_log.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/event_log.py b/event_log.py
index 315d752d..c77c5648 100644
--- a/event_log.py
+++ b/event_log.py
@@ -1,5 +1,3 @@
1# -*- coding:utf-8 -*-
2#
3# Copyright (C) 2017 The Android Open Source Project 1# Copyright (C) 2017 The Android Open Source Project
4# 2#
5# Licensed under the Apache License, Version 2.0 (the "License"); 3# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,8 +12,6 @@
14# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
15# limitations under the License. 13# limitations under the License.
16 14
17from __future__ import print_function
18
19import json 15import json
20import multiprocessing 16import multiprocessing
21 17
@@ -23,6 +19,7 @@ TASK_COMMAND = 'command'
23TASK_SYNC_NETWORK = 'sync-network' 19TASK_SYNC_NETWORK = 'sync-network'
24TASK_SYNC_LOCAL = 'sync-local' 20TASK_SYNC_LOCAL = 'sync-local'
25 21
22
26class EventLog(object): 23class EventLog(object):
27 """Event log that records events that occurred during a repo invocation. 24 """Event log that records events that occurred during a repo invocation.
28 25
@@ -138,7 +135,7 @@ class EventLog(object):
138 Returns: 135 Returns:
139 A dictionary of the event added to the log. 136 A dictionary of the event added to the log.
140 """ 137 """
141 event['status'] = self.GetStatusString(success) 138 event['status'] = self.GetStatusString(success)
142 event['finish_time'] = finish 139 event['finish_time'] = finish
143 return event 140 return event
144 141
@@ -165,6 +162,7 @@ class EventLog(object):
165# An integer id that is unique across this invocation of the program. 162# An integer id that is unique across this invocation of the program.
166_EVENT_ID = multiprocessing.Value('i', 1) 163_EVENT_ID = multiprocessing.Value('i', 1)
167 164
165
168def _NextEventId(): 166def _NextEventId():
169 """Helper function for grabbing the next unique id. 167 """Helper function for grabbing the next unique id.
170 168