Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed Mar 28, 2024
1 parent bbfa39c commit 7408471
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions transactron/lib/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,35 +555,37 @@ 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.
Parameters
----------
m: TModule
Transactron module
slot: ValueLike
The slot index of the event.
"""

if not self.metrics_enabled():
return

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.
Parameters
----------
m: TModule
Transactron module
slot: ValueLike
The slot index of the event.
"""

if not self.metrics_enabled():
Expand Down

0 comments on commit 7408471

Please sign in to comment.