BloombergLP::balb::PerformanceMonitor

Provides a mechanism to collect performance statistics for an arbitrary number of processes running on the local machine.

Synopsis

Declared in <balb_performancemonitor.h>

class PerformanceMonitor;

Types

NameDescription
ConstIterator Provide a mechanism that models the "Forward Iterator" concept over a collection of non-modifiable performance statistics.
Statistics Defines the performance statistics collected for a monitored process. Note that this class is not fully value-semantic. It is intended to provide a read-only view of a set of collected performance statistics.

Enums

NameDescription
Measure Enumerates the set of performance measures this class is capable of monitoring. Note that CPU utilization measures are calculated as a ratio of CPU time to elapsed time between two consecutive calls to collect, and therefore no value will be available if collect has been called only once. Note that not all measures are supported on all platforms; for an unsupported measure, the behavior is as if the system reports a zero value.

Member Functions

NameDescription
PerformanceMonitor [constructor]Constructors
~PerformanceMonitor [destructor]Destroy this object.
begin Return an iterator positioned at the first set of collected performance statistics.
collect Collect performance statistics for each registered pid.
end Return an iterator that represents the end of the sequence of sets of collected performance statistics.
find Return the iterator pointing to the set of collected performance statistics for the specified pid if pid has been registered with this performance monitor through the registerPid function, otherwise return end(). A pid value of zero is translated to the current process id.
numRegisteredPids Return the number of processes registered for statistics collection.
registerPid Register the specified process pid having the specified user-defined description with this performance monitor. After registration, performance statistics will be collected for the pid upon invocation of the collect function. A pid value of zero is translated to the current process id. Return 0 on success or a non-zero value otherwise.
resetStatistics Reset the collected min, max, and average values collected for each measure for each monitored process. Note that this method will call collect once for each monitored process, so the statistics after this method returns will be based on the values collected thereby.
setCollectionInterval Set the specified time interval, in seconds, after which statistics for each registered pid are automatically collected. The behavior is undefined unless a scheduler was supplied at the construction of this performance monitor. A non-positive interval value indicates that performance statistics should not be automatically collected--in this case the user is responsible for manually calling the collect function.
unregisterPid Unregister the specified process pid from the performance monitor. After unregistration, to statistics for the pid will be no longer be available unless the pid is re-registered with the performance monitor through calling registerPid. A pid value of zero is translated to the current process id. Return 0 on success or a non-zero value otherwise.
operator BloombergLP::bslmf::NestedTraitDeclaration<PerformanceMonitor, UsesBslmaAllocator> Declare that this type uses a bslma allocator.

Friends

NameDescription
BloombergLP::balb::PerformanceMonitor::ConstIteratorProvide a mechanism that models the "Forward Iterator" concept over a collection of non-modifiable performance statistics.
BloombergLP::balb::PerformanceMonitor::StatisticsDefines the performance statistics collected for a monitored process. Note that this class is not fully value-semantic. It is intended to provide a read-only view of a set of collected performance statistics.