A profiler which provides a set of callbacks for several actor operations in order to collect fine-grained profiling state about the system.
More...
#include <actor_profiler.hpp>
A profiler which provides a set of callbacks for several actor operations in order to collect fine-grained profiling state about the system.
- Attention
- This feature is experimental.
◆ add_actor()
Called whenever the actor system spawns a new actor.
The system calls this member function after the constructor of self
has completed but before constructing the behavior.
- Parameters
-
self | The new actor. |
parent | Points to the parent actor unless self is a top-level actor (in this case, parent has the value nullptr ). @thread-safe |
◆ after_processing()
Called after an actor processed an element from its mailbox.
- Parameters
-
self | The current actor. |
result | Stores whether the actor consumed, skipped or dropped the message. @thread-safe |
◆ before_processing()
virtual void caf::actor_profiler::before_processing |
( |
const local_actor & |
self, |
|
|
const mailbox_element & |
element |
|
) |
| |
|
pure virtual |
Called whenever an actor is about to process an element from its mailbox.
- Parameters
-
self | The current actor. |
element | The current element from the mailbox. @thread-safe |
◆ before_sending()
virtual void caf::actor_profiler::before_sending |
( |
const local_actor & |
self, |
|
|
mailbox_element & |
element |
|
) |
| |
|
pure virtual |
Called whenever an actor is about to send a message.
Allows the profiler to inject arbitrary meta data before putting the mailbox element into the mailbox of the receiver.
- Parameters
-
self | The current actor. |
element | The outgoing mailbox element. |
- Note
- The profiler gets a mutable reference to
element
, but it is only supposed to inject meta data. Not to alter the message itself. Doing so is an easy way to introduce bugs that are very hard to track down. @thread-safe
◆ before_sending_scheduled()
Analogous to before_sending
, but called whenever an actor is about to call actor_clock::schedule_message
.
- Parameters
-
self | The current actor. |
timeout | Time point for the message delivery. |
element | The outgoing mailbox element. @thread-safe |
◆ remove_actor()
virtual void caf::actor_profiler::remove_actor |
( |
const local_actor & |
self | ) |
|
|
pure virtual |
Called before the actor system calls the destructor for self
.
- Parameters
-
self | Points to an actor that is about to get destroyed. @thread-safe |
The documentation for this class was generated from the following files:
- libcaf_core/caf/actor_profiler.hpp
- libcaf_core/caf/actor_profiler.cpp