summaryrefslogtreecommitdiff
path: root/buildstream/_message.py
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-02-28 18:01:28 +0000
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-03-01 14:36:08 +0000
commitc3f1a2e1e1f7aa7d01f263ba3b2eb644f5bdb638 (patch)
treec77fd6cadb278f36b34244b36ad93da78eb50563 /buildstream/_message.py
parent14234ccce3e7eec1153e810fab75afb2e90a2b22 (diff)
downloadbuildstream-c3f1a2e1e1f7aa7d01f263ba3b2eb644f5bdb638.tar.gz
Add the FixedText and WallclockTime widgets
WallclockTime is set at the time a message is created. Since messages can be placed in queues before being rendered, this is not always the same time as the wallclock time when rendering the message, so it needs to be stored in the message. widget.py: Add the two new widgets _message.py: record system time when a message is created.
Diffstat (limited to 'buildstream/_message.py')
-rw-r--r--buildstream/_message.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/buildstream/_message.py b/buildstream/_message.py
index 5183a0df2..0cf7fb385 100644
--- a/buildstream/_message.py
+++ b/buildstream/_message.py
@@ -18,6 +18,7 @@
# Authors:
# Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
+import datetime
import os
@@ -74,5 +75,6 @@ class Message():
self.task_id = task_id # The plugin object ID of the task
self.scheduler = scheduler # Whether this is a scheduler level message
self.sequence_id = sequence_id # Unique ID for a task, so we can track all messages per task
+ self.creation_time = datetime.datetime.now()
if message_type in (MessageType.SUCCESS, MessageType.FAIL):
assert(elapsed is not None)