From 12c28bb61d8ff178548b3c594575cc7bd50f5c7f Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Thu, 12 Mar 2015 13:11:31 -0700 Subject: [PATCH] Ensure event time listener is in listeners docs Also expands the docstring so its known what keys this stores under and what data it is recording. Change-Id: Id2949ca6acc27d4bf41e37743f705d653f426c05 --- doc/source/notifications.rst | 7 +++++-- taskflow/listeners/timing.py | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/source/notifications.rst b/doc/source/notifications.rst index 4e037c26..816393ed 100644 --- a/doc/source/notifications.rst +++ b/doc/source/notifications.rst @@ -170,6 +170,8 @@ Timing listeners .. autoclass:: taskflow.listeners.timing.PrintingDurationListener +.. autoclass:: taskflow.listeners.timing.EventTimeListener + Claim listener -------------- @@ -191,6 +193,7 @@ Hierarchy taskflow.listeners.logging.DynamicLoggingListener taskflow.listeners.logging.LoggingListener taskflow.listeners.printing.PrintingListener - taskflow.listeners.timing.PrintingTimingListener - taskflow.listeners.timing.TimingListener + taskflow.listeners.timing.PrintingDurationListener + taskflow.listeners.timing.EventTimeListener + taskflow.listeners.timing.DurationListener :parts: 1 diff --git a/taskflow/listeners/timing.py b/taskflow/listeners/timing.py index bf9b5229..17d289d6 100644 --- a/taskflow/listeners/timing.py +++ b/taskflow/listeners/timing.py @@ -121,7 +121,16 @@ PrintingTimingListener = moves.moved_class( class EventTimeListener(base.Listener): - """Writes task, flow, and retry event timestamps to atom metadata.""" + """Listener that captures task, flow, and retry event timestamps. + + It records how when an event is received (using unix time) to + storage. It saves the timestamps under keys (in atom or flow details + metadata) of the format ``{event}-timestamp`` where ``event`` is the + state/event name that has been received. + + This information can be later extracted/examined to derive durations... + """ + def __init__(self, engine, task_listen_for=base.DEFAULT_LISTEN_FOR, flow_listen_for=base.DEFAULT_LISTEN_FOR,