CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
Loading...
Searching...
No Matches
cmlabs::ProcessStats Struct Reference

Per-process throughput counters and recent-message rings, kept in shared memory. More...

#include <ProcessMemory.h>

Public Member Functions

std::string toXML ()
 Serialize counters and recent messages as a <processstats> XML element.

Public Attributes

uint64 time
 Timestamp of the last update (µs).
uint64 msgInCount
 Total messages received.
uint64 msgInBytes
 Total bytes received.
char recentInMsg [10 *DRAFTMSGSIZE]
 Ring of the 10 most recent inbound message drafts.
uint64 msgOutCount
 Total messages sent.
uint64 msgOutBytes
 Total bytes sent.
char recentOutMsg [10 *DRAFTMSGSIZE]
 Ring of the 10 most recent outbound message drafts.
uint64 procMemUsage
 Current process memory footprint in bytes.
uint64 currentCPUTicks
 Cumulative CPU ticks consumed.
uint32 recentInPos
uint32 recentOutPos

Detailed Description

Per-process throughput counters and recent-message rings, kept in shared memory.

The recentInMsg/recentOutMsg buffers are rings of 10 DRAFTMSGSIZE-byte serialized message drafts, indexed by recentInPos/recentOutPos, used for live inspection tools.

Warning
Shared-memory layout; see MemoryManager.h for the ABI/rebuild warning.

Definition at line 63 of file ProcessMemory.h.

Member Function Documentation

◆ toXML()

std::string cmlabs::ProcessStats::toXML ( )
inline

Serialize counters and recent messages as a <processstats> XML element.

Returns
XML fragment.

Definition at line 77 of file ProcessMemory.h.

References DRAFTMSGSIZE, msgInBytes, msgInCount, msgOutBytes, msgOutCount, procMemUsage, recentInMsg, recentOutMsg, cmlabs::utils::StringFormat(), cmlabs::DataMessage::swapMessageData(), time, and cmlabs::DataMessage::toXML().

Member Data Documentation

◆ currentCPUTicks

uint64 cmlabs::ProcessStats::currentCPUTicks

Cumulative CPU ticks consumed.

Definition at line 72 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addLocalPerformanceStats().

◆ msgInBytes

uint64 cmlabs::ProcessStats::msgInBytes

Total bytes received.

Definition at line 66 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addLocalPerformanceStats(), and toXML().

◆ msgInCount

uint64 cmlabs::ProcessStats::msgInCount

Total messages received.

Definition at line 65 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addLocalPerformanceStats(), and toXML().

◆ msgOutBytes

uint64 cmlabs::ProcessStats::msgOutBytes

Total bytes sent.

Definition at line 69 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addLocalPerformanceStats(), and toXML().

◆ msgOutCount

uint64 cmlabs::ProcessStats::msgOutCount

Total messages sent.

Definition at line 68 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addLocalPerformanceStats(), and toXML().

◆ procMemUsage

uint64 cmlabs::ProcessStats::procMemUsage

Current process memory footprint in bytes.

Definition at line 71 of file ProcessMemory.h.

Referenced by toXML().

◆ recentInMsg

char cmlabs::ProcessStats::recentInMsg[10 *DRAFTMSGSIZE]

Ring of the 10 most recent inbound message drafts.

Definition at line 67 of file ProcessMemory.h.

Referenced by toXML().

◆ recentInPos

uint32 cmlabs::ProcessStats::recentInPos

Definition at line 73 of file ProcessMemory.h.

◆ recentOutMsg

char cmlabs::ProcessStats::recentOutMsg[10 *DRAFTMSGSIZE]

Ring of the 10 most recent outbound message drafts.

Definition at line 70 of file ProcessMemory.h.

Referenced by toXML().

◆ recentOutPos

uint32 cmlabs::ProcessStats::recentOutPos

Definition at line 74 of file ProcessMemory.h.

◆ time

uint64 cmlabs::ProcessStats::time

Timestamp of the last update (µs).

Definition at line 64 of file ProcessMemory.h.

Referenced by cmlabs::ProcessMemory::addToProcessStats(), and toXML().


The documentation for this struct was generated from the following file: