From ad8bd6f9632aed8ab07a537451fa0479bdae3e31 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Wed, 7 Mar 2018 14:55:54 +0000 Subject: Revert "Add sequence ID and widget for it." This reverts commit 14234ccce3e7eec1153e810fab75afb2e90a2b22. --- buildstream/_context.py | 16 ++++------------ buildstream/_frontend/widget.py | 12 ------------ buildstream/_message.py | 4 +--- 3 files changed, 5 insertions(+), 27 deletions(-) (limited to 'buildstream') diff --git a/buildstream/_context.py b/buildstream/_context.py index 3f5a4d62f..d93aa749f 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -30,7 +30,6 @@ from ._exceptions import LoadError, LoadErrorReason, BstError from ._message import Message, MessageType from ._profile import Topics, profile_start, profile_end from ._artifactcache import artifact_cache_specs_from_config_node -from threading import Lock # Context() @@ -46,9 +45,6 @@ from threading import Lock # class Context(): - # Class-level static variable used to distinguish timed activities - sequence_ids = 0 - def __init__(self, *, fetch_subprojects=False): # Filename indicating which configuration file was used, or None for the defaults @@ -368,14 +364,10 @@ class Context(): # @contextmanager def _timed_activity(self, activity_name, *, unique_id=None, detail=None, silent_nested=False): + starttime = datetime.datetime.now() stopped_time = None - with Lock(): - # Atomically increase the sequence counter - Context.sequence_ids += 1 - sequence_id = Context.sequence_ids - def stop_time(): nonlocal stopped_time stopped_time = datetime.datetime.now() @@ -389,7 +381,7 @@ class Context(): with _signals.suspendable(stop_time, resume_time): try: # Push activity depth for status messages - message = Message(unique_id, MessageType.START, activity_name, detail=detail, sequence_id=sequence_id) + message = Message(unique_id, MessageType.START, activity_name, detail=detail) self._message(message) self._push_message_depth(silent_nested) yield @@ -398,13 +390,13 @@ class Context(): # Note the failure in status messages and reraise, the scheduler # expects an error when there is an error. elapsed = datetime.datetime.now() - starttime - message = Message(unique_id, MessageType.FAIL, activity_name, elapsed=elapsed, sequence_id=sequence_id) + message = Message(unique_id, MessageType.FAIL, activity_name, elapsed=elapsed) self._pop_message_depth() self._message(message) raise elapsed = datetime.datetime.now() - starttime - message = Message(unique_id, MessageType.SUCCESS, activity_name, elapsed=elapsed, sequence_id=sequence_id) + message = Message(unique_id, MessageType.SUCCESS, activity_name, elapsed=elapsed) self._pop_message_depth() self._message(message) diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py index 2eb9e10ba..c8c366d99 100644 --- a/buildstream/_frontend/widget.py +++ b/buildstream/_frontend/widget.py @@ -284,18 +284,6 @@ class LogFile(Widget): return text -class SequenceID(Widget): - """ A unique Sequence ID is created for each timed_activity, and can - be used to associate all log lines from a particular - activity. - """ - def render(self, message): - if message.sequence_id is None: - return self.content_profile.fmt("-") - else: - return self.content_profile.fmt(str(message.sequence_id)) - - class MessageOrLogFile(Widget): """ START and SUCCESS messages are expected to have no useful information in the message text, so we display the logfile name for diff --git a/buildstream/_message.py b/buildstream/_message.py index 0cf7fb385..e16766023 100644 --- a/buildstream/_message.py +++ b/buildstream/_message.py @@ -60,8 +60,7 @@ class Message(): depth=None, logfile=None, sandbox=None, - scheduler=False, - sequence_id=None): + scheduler=False): self.message_type = message_type # Message type self.message = message # The message string self.detail = detail # An additional detail string @@ -74,7 +73,6 @@ class Message(): self.unique_id = unique_id # The plugin object ID issueing the 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) -- cgit v1.2.1