libmuscle.profiler module

class libmuscle.profiler.Profiler(instance_id: ymmsl.identity.Reference, manager: libmuscle.mmp_client.MMPClient)[source]

Bases: object

Collects profiling events and sends them to the manager.

Create a Profiler.

Parameters

manager – The client used to submit data to the manager.

record_event(event: libmuscle.profiling.ProfileEvent) None[source]

Record a profiling event.

This will record the event, and may flush this and previously recorded events to the manager.

Parameters

event – The event to record.

shutdown() None[source]
start(event_type: libmuscle.profiling.ProfileEventType, port: Optional[ymmsl.component.Port] = None, port_length: Optional[int] = None, slot: Optional[int] = None, message_size: Optional[int] = None) libmuscle.profiling.ProfileEvent[source]

Start measuring an event.

Call this, then call stop() on the returned ProfileEvent at the end of the event.

Parameters
  • instance_id – Instance for which this event occurred.

  • event_type – Type of event that occurred.

  • port – Port that was sent or received on.

  • port_length – Length of the port, if vector.

  • slot – Slot that was sent or received on.

  • message_size – Size in bytes of the message.

Returns

A new ProfileEvent.