From 74084719f9ca08ec2afc8e5587537a640a9a018a Mon Sep 17 00:00:00 2001 From: Marek Materzok Date: Thu, 28 Mar 2024 11:11:53 +0100 Subject: [PATCH] Documentation --- transactron/lib/metrics.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/transactron/lib/metrics.py b/transactron/lib/metrics.py index d52377ba6..816225765 100644 --- a/transactron/lib/metrics.py +++ b/transactron/lib/metrics.py @@ -555,10 +555,9 @@ def _(slot): return m - def start(self, m: TModule, slot: ValueLike): + def start(self, m: TModule, *, slot: ValueLike): """ - Registers the start of an event. Can be called before the previous events - finish. If there are no slots available, the method will be blocked. + Registers the start of an event for a given slot index. Should be called in the body of either a transaction or a method. @@ -566,6 +565,8 @@ def start(self, m: TModule, slot: ValueLike): ---------- m: TModule Transactron module + slot: ValueLike + The slot index of the event. """ if not self.metrics_enabled(): @@ -573,10 +574,9 @@ def start(self, m: TModule, slot: ValueLike): self._start(m, slot) - def stop(self, m: TModule, slot: ValueLike): + def stop(self, m: TModule, *, slot: ValueLike): """ - Registers the end of the oldest event (the FIFO order). If there are no - started events in the queue, the method will block. + Registers the end of the event for a given slot index. Should be called in the body of either a transaction or a method. @@ -584,6 +584,8 @@ def stop(self, m: TModule, slot: ValueLike): ---------- m: TModule Transactron module + slot: ValueLike + The slot index of the event. """ if not self.metrics_enabled():