Events
Module contains events processing mechanisms that are integrated with the standard python logging.
Example of usage:
from torchelastic import events
event = Event(name="test_event", source=EventSource.WORKER, metadata={...})
events.get_events_logger(destination="default").info(event)
API Methods
-
torchelastic.events.
record
(event: torchelastic.events.api.Event, destination: str = 'console') → None[source]
-
torchelastic.events.
get_logging_handler
(destination: str = 'console') → logging.Handler[source]
Event Objects
-
class
torchelastic.events.api.
Event
(name: str, source: torchelastic.events.api.EventSource, timestamp: int = 0, metadata: Dict[str, Optional[Union[str, int, float, bool]]] = <factory>)[source] The class represents the generic event that occurs during the torchelastic job execution. The event can be any kind of meaningful action.
- Parameters
name – event name.
source – the event producer, e.g. agent or worker
timestamp – timestamp in milliseconds when event occured.
metadata – additional data that is associated with the event.
-
class
torchelastic.events.api.
EventSource
(value)[source] Known identifiers of the event producers.