BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balb::PerformanceMonitor::Statistics Class Reference

#include <balb_performancemonitor.h>

Detailed Description

Defines the performance statistics collected for a monitored process.

Note
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.

See balb_performancemonitor

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (Statistics, bslma::UsesBslmaAllocator)
 
 Statistics (bslma::Allocator *basicAllocator=0)
 
 Statistics (const Statistics &original, bslma::Allocator *basicAllocator=0)
 
void reset ()
 
double latestValue (Measure measure) const
 
double minValue (Measure measure) const
 
double maxValue (Measure measure) const
 
double avgValue (Measure measure) const
 
int pid () const
 
const bsl::stringdescription () const
 
double elapsedTime () const
 
const bdlt::DatetimestartupTime () const
 
void print (bsl::ostream &os) const
 
void print (bsl::ostream &os, Measure measure) const
 
void print (bsl::ostream &os, const char *measureIdentifier) const
 

Friends

class Collector< OsType >
 

Constructor & Destructor Documentation

◆ Statistics() [1/2]

balb::PerformanceMonitor::Statistics::Statistics ( bslma::Allocator basicAllocator = 0)
explicit

Create an instance of this class. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ Statistics() [2/2]

balb::PerformanceMonitor::Statistics::Statistics ( const Statistics original,
bslma::Allocator basicAllocator = 0 
)

Create a Statistics object aggregating the same statistics values as the specified original object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

Member Function Documentation

◆ avgValue()

double balb::PerformanceMonitor::Statistics::avgValue ( Measure  measure) const

Return the average of the collected values for the specified metric, or an unspecified value if no values have been collected.

◆ BSLMF_NESTED_TRAIT_DECLARATION()

balb::PerformanceMonitor::Statistics::BSLMF_NESTED_TRAIT_DECLARATION ( Statistics  ,
bslma::UsesBslmaAllocator   
)

◆ description()

const bsl::string & balb::PerformanceMonitor::Statistics::description ( ) const
inline

Return the user-supplied description of the process identified by the result of the pid() function.

◆ elapsedTime()

double balb::PerformanceMonitor::Statistics::elapsedTime ( ) const
inline

Return the number of seconds (in wall time) that have elapsed since the startup the process identified by the result of the pid() function.

◆ latestValue()

double balb::PerformanceMonitor::Statistics::latestValue ( Measure  measure) const
inline

Return the latest collected value for the specified measure, or 0 if no values are yet available.

◆ maxValue()

double balb::PerformanceMonitor::Statistics::maxValue ( Measure  measure) const
inline

Return the maximum collected value for the specified measure, or a large negative value if no values have been collected.

◆ minValue()

double balb::PerformanceMonitor::Statistics::minValue ( Measure  measure) const
inline

Return the minimum collected value for the specified measure, or a large positive value if no values have been collected.

◆ pid()

int balb::PerformanceMonitor::Statistics::pid ( ) const
inline

Return the pid for which these statistics were collected.

◆ print() [1/3]

void balb::PerformanceMonitor::Statistics::print ( bsl::ostream &  os) const

Print all collected statistics to the specified os stream.

◆ print() [2/3]

void balb::PerformanceMonitor::Statistics::print ( bsl::ostream &  os,
const char *  measureIdentifier 
) const

Print the specified measureIdentifier to the specified os stream. The value of measureIdentifier should be a string literal corresponding to the desired measure enumerator, e.g., e_CPU_TIME.

◆ print() [3/3]

void balb::PerformanceMonitor::Statistics::print ( bsl::ostream &  os,
Measure  measure 
) const

Print the specified measure to the specified os stream.

◆ reset()

void balb::PerformanceMonitor::Statistics::reset ( )

Reset this object to the state in which no samples have been collected.

Note
Note that although this method is public, it can't be called directly by users, since PerformanceMonitor provides only const access to statistics.

◆ startupTime()

const bdlt::Datetime & balb::PerformanceMonitor::Statistics::startupTime ( ) const
inline

Return the startup time in Coordinated Universal Time.

Friends And Related Symbol Documentation

◆ Collector< OsType >

friend class Collector< OsType >
friend

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