geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Classes | Public Member Functions | Static Public Member Functions | List of all members
geopm::StatsCollector Class Referenceabstract

Class that accumulates statistics based on PlatformIO requests. More...

#include <StatsCollector.hpp>

Inheritance diagram for geopm::StatsCollector:
Inheritance graph
[legend]

Classes

struct  report_s
 

Public Member Functions

 StatsCollector ()=default
 Default null constructor without requests. More...
 
virtual ~StatsCollector ()=default
 Default destructor. More...
 
virtual void update (void)=0
 Sample PlatformIO and update all tracked signals. More...
 
virtual std::string report_yaml (void) const =0
 Generate a YAML report of statistics. More...
 
virtual void reset (void)=0
 May be called after report_yaml() to reset statistics. More...
 
virtual report_s report_struct (void) const =0
 Return report of statistics in a structure representation. More...
 
virtual size_t update_count (void) const =0
 Number of updates since last reset. More...
 

Static Public Member Functions

static std::unique_ptr< StatsCollectormake_unique (const std::vector< geopm_request_s > &requests)
 Factory access method. More...
 

Detailed Description

Class that accumulates statistics based on PlatformIO requests.

Constructor & Destructor Documentation

◆ StatsCollector()

geopm::StatsCollector::StatsCollector ( )
default

Default null constructor without requests.

◆ ~StatsCollector()

virtual geopm::StatsCollector::~StatsCollector ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ make_unique()

std::unique_ptr< StatsCollector > geopm::StatsCollector::make_unique ( const std::vector< geopm_request_s > &  requests)
static

Factory access method.

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
Returns
Unique pointer to StatCollector object

◆ report_struct()

virtual report_s geopm::StatsCollector::report_struct ( void  ) const
pure virtual

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.

Implemented in geopm::StatsCollectorImp.

◆ report_yaml()

virtual std::string geopm::StatsCollector::report_yaml ( void  ) const
pure virtual

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

Implemented in geopm::StatsCollectorImp.

◆ reset()

virtual void geopm::StatsCollector::reset ( void  )
pure virtual

May be called after report_yaml() to reset statistics.

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

Implemented in geopm::StatsCollectorImp.

◆ update()

virtual void geopm::StatsCollector::update ( void  )
pure virtual

Sample PlatformIO and update all tracked signals.

Implemented in geopm::StatsCollectorImp.

◆ update_count()

virtual size_t geopm::StatsCollector::update_count ( void  ) const
pure virtual

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

Implemented in geopm::StatsCollectorImp.


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