BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balb::PerformanceMonitor::Statistics Class Reference

#include <balb_performancemonitor.h>

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
 Return the latest collected value for the specified measure.
 
double minValue (Measure measure) const
 Return the minimum collected value for the specified measure.
 
double maxValue (Measure measure) const
 Return the maximum collected value for the specified measure.
 
double avgValue (Measure measure) const
 
int pid () const
 Return the pid for which these statistics were collected.
 
const bsl::stringdescription () const
 
double elapsedTime () const
 
const bdlt::DatetimestartupTime () const
 Return the startup time in Coordinated Universal Time.
 
void print (bsl::ostream &os) const
 Print all collected statistics to the specified os stream.
 
void print (bsl::ostream &os, Measure measure) const
 Print the specified measure to the specified os stream.
 
void print (bsl::ostream &os, const char *measureIdentifier) const
 

Friends

class Collector< OsType >
 

Detailed Description

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.

See balb_performancemonitor

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
inline

Return the average of the collected values for the specified metric.

◆ 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

◆ maxValue()

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

◆ minValue()

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

◆ pid()

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

◆ print() [1/3]

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

◆ 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

◆ reset()

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

Reset the min, max, and average values collected for each measure.

◆ startupTime()

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

Friends And Related Symbol Documentation

◆ Collector< OsType >

friend class Collector< OsType >
friend

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