Template Class MemPoolIntrospection

Class Documentation

template<typename MemoryManager, typename SegmentManager, typename PublisherPort>
class MemPoolIntrospection

This class handles the mempool intropection for RouDi. It is recommended to use the MemPoolIntrospectionType alias which sets the intended template parameters required for the actual introspection. The class sends snapshots of the mempool usage to the introspection client if subscribed.

Public Functions

MemPoolIntrospection(MemoryManager &rouDiInternalMemoryManager, SegmentManager &segmentManager, PublisherPort &&publisherPort) noexcept

The constructor for the MemPoolIntrospection. It starts a thread and set it into a wait condition.

Parameters:
  • rouDiInternalMemoryManager[in] is the internal RouDi memory manager

  • segmentManager[in] contains the shared memory segments and their memory pools which will be intropected

  • publisherPort[in] is the publisher port for transmission of the introspection data

~MemPoolIntrospection() noexcept
MemPoolIntrospection(MemPoolIntrospection const&) = delete
MemPoolIntrospection &operator=(MemPoolIntrospection const&) = delete
MemPoolIntrospection(MemPoolIntrospection&&) = delete
MemPoolIntrospection &operator=(MemPoolIntrospection&&) = delete
void run() noexcept

This function starts the periodic transmission of snapshots of the mempool introspecton data. The send interval can be set by setSendInterval(…). By default it’s 1 second.

void stop() noexcept

This function stops the thread which sends the introspection data. It is not possible to start the thread again.

void setSendInterval(const units::Duration interval) noexcept

This function configures the interval for the transmission of the mempool introspection data.

Parameters:

interval[in] duration between two send invocations

Protected Functions

void send() noexcept

Protected Attributes

MemoryManager *m_rouDiInternalMemoryManager = {nullptr}
SegmentManager *m_segmentManager = {nullptr}
PublisherPort m_publisherPort = {nullptr}