libmuscle.profiler module

class libmuscle.profiler.Profiler(instance_id: Reference, manager: 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: 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: ProfileEventType, port: Optional[Port] = None, port_length: Optional[int] = None, slot: Optional[int] = None, message_size: Optional[int] = None) 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.