geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::StatsCollectorImp Class Reference

#include <StatsCollector.hpp>

Inheritance diagram for geopm::StatsCollectorImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::StatsCollectorImp:
Collaboration graph
[legend]

Public Member Functions

 StatsCollectorImp ()
 Default null constructor without requests. More...
 
 StatsCollectorImp (const std::vector< geopm_request_s > &requests)
 Standard constructor with requests. More...
 
 StatsCollectorImp (const std::vector< geopm_request_s > &requests, PlatformIO &pio)
 Test constructor used to mock PlatformIO. More...
 
 ~StatsCollectorImp ()=default
 Default destructor. More...
 
void update (void) override
 Sample PlatformIO and update all tracked signals. More...
 
std::string report_yaml (void) const override
 Generate a YAML report of statistics. More...
 
void reset (void) override
 May be called after report_yaml() to reset statistics. More...
 
report_s report_struct (void) const override
 Return report of statistics in a structure representation. More...
 
size_t update_count (void) const override
 Number of updates since last reset. More...
 
- Public Member Functions inherited from geopm::StatsCollector
 StatsCollector ()=default
 Default null constructor without requests. More...
 
virtual ~StatsCollector ()=default
 Default destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::StatsCollector
static std::unique_ptr< StatsCollectormake_unique (const std::vector< geopm_request_s > &requests)
 Factory access method. More...
 

Constructor & Destructor Documentation

◆ StatsCollectorImp() [1/3]

geopm::StatsCollectorImp::StatsCollectorImp ( )

Default null constructor without requests.

◆ StatsCollectorImp() [2/3]

geopm::StatsCollectorImp::StatsCollectorImp ( const std::vector< geopm_request_s > &  requests)

Standard constructor with requests.

User specifies a vector of PlatformIO signal requests to be accumulated. The report will generate statistics about each signal request.

Parameters
[in]requestsAll signals for monitoring and reporting

◆ StatsCollectorImp() [3/3]

geopm::StatsCollectorImp::StatsCollectorImp ( const std::vector< geopm_request_s > &  requests,
PlatformIO pio 
)

Test constructor used to mock PlatformIO.

◆ ~StatsCollectorImp()

geopm::StatsCollectorImp::~StatsCollectorImp ( )
default

Default destructor.

Member Function Documentation

◆ report_struct()

StatsCollectorImp::report_s geopm::StatsCollectorImp::report_struct ( void  ) const
overridevirtual

Return report of statistics in a structure representation.

Creates a report_s structure providing statistics about all samples gathered since object construction or since last call to reset().

Returns
report_s structure containing vectors of metric_names and metric_stats based on constructor requests.

Implements geopm::StatsCollector.

◆ report_yaml()

std::string geopm::StatsCollectorImp::report_yaml ( void  ) const
overridevirtual

Generate a YAML report of statistics.

Returns a YAML formatted report providing statisics about all samples gathered since object construction or since last call to reset().

Returns
YAML report string that includes hostname, start date, end date, and signal statistics

Implements geopm::StatsCollector.

◆ reset()

void geopm::StatsCollectorImp::reset ( void  )
overridevirtual

May be called after report_yaml() to reset statistics.

Used to generate independent reports by clearing all gathered statistics and resetting the begin time.

Implements geopm::StatsCollector.

◆ update()

void geopm::StatsCollectorImp::update ( void  )
overridevirtual

Sample PlatformIO and update all tracked signals.

Implements geopm::StatsCollector.

◆ update_count()

size_t geopm::StatsCollectorImp::update_count ( void  ) const
overridevirtual

Number of updates since last reset.

Returns the number of times the update() method has been called since object construction or last call to reset().

Returns
Number of updates

Implements geopm::StatsCollector.


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