geopm
3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
|
#include <SampleAggregatorImp.hpp>
Public Member Functions | |
SampleAggregatorImp () | |
SampleAggregatorImp (PlatformIO &platio) | |
int | push_signal (const std::string &signal_name, int domain_type, int domain_idx) override |
Push a signal to be accumulated per-region. More... | |
int | push_signal_total (const std::string &signal_idx, int domain_type, int domain_idx) override |
Push a signal to be accumulated per-region as a total. More... | |
int | push_signal_average (const std::string &signal_idx, int domain_type, int domain_idx) override |
Push a signal to be accumulated per-region as an average. More... | |
void | update (void) override |
Update stored totals for each signal. More... | |
double | sample_application (int signal_idx) override |
Get the aggregated value of a signal. More... | |
double | sample_epoch (int signal_idx) override |
Get the aggregated value of a signal since the first epoch. More... | |
double | sample_region (int signal_idx, uint64_t region_hash) override |
Get the aggregated value of a signal during the execution of a particular region. More... | |
double | sample_epoch_last (int signal_idx) override |
Get the aggregated value of a signal over the last completed epoch interval. More... | |
double | sample_region_last (int signal_idx, uint64_t region_hash) override |
Get the aggregated value of a signal during the the last completed execution of a particular region. More... | |
void | period_duration (double duration) override |
Set the time period for sample_period_last() More... | |
int | get_period (void) override |
Get the index of the current time period. More... | |
double | sample_period_last (int signal_idx) override |
Get the aggregated value of a signal during the last completed time interval. More... | |
Public Member Functions inherited from geopm::SampleAggregator | |
virtual | ~SampleAggregator ()=default |
Default destructor of pure virtual base. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from geopm::SampleAggregator | |
static std::unique_ptr< SampleAggregator > | make_unique (void) |
Returns a unique_ptr to a concrete object constructed using the underlying implementation. More... | |
Protected Member Functions inherited from geopm::SampleAggregator | |
SampleAggregator ()=default | |
geopm::SampleAggregatorImp::SampleAggregatorImp | ( | ) |
geopm::SampleAggregatorImp::SampleAggregatorImp | ( | PlatformIO & | platio | ) |
|
overridevirtual |
Get the index of the current time period.
Provides an index of completed durations. Will return zero if periodic sampling is not enabled (when period_duration() was not called prior to update()). When periodic sampling is enabled, the sample_period_last() method will return 0.0 until a full period has elapsed, this corresponds to when get_period() returns a value greater than zero.
Implements geopm::SampleAggregator.
|
overridevirtual |
Set the time period for sample_period_last()
Calling this method prior to the first call to update() enables signals to be accumulated on a periodic basis. The sample_period_last() method is used to sample an accumulated value over the last completed time interval, and the period of the interval is configured by calling this method.
The sample_period_last() method will always return NAN If period_duration() is not called prior to the first call to update(). The period_duration() method will throw an Exception if it is called after the first call to update().
[in] | duration | Time interval in seconds over which the sample_region_last() method is aggregated (must be greater than 0.0). |
Implements geopm::SampleAggregator.
|
overridevirtual |
Push a signal to be accumulated per-region.
Check the signal behavior and call push_signal_total() or push_signal_average() accordingly.
[in] | signal_name | Name of the signal to sample and aggregate. |
[in] | domain_type | Domain type over which the region hash and signal should be sampled. |
[in] | domain_idx | Domain over which the region hash and signal should be sampled. |
Implements geopm::SampleAggregator.
|
overridevirtual |
Push a signal to be accumulated per-region as an average.
The signal name must be a valid signal available through PlatformIO. Note that unlike other signals this is an average value accumulated per region by a time weighted mean of the values sampled while in the region. Region entry and exit are not exact and are determined by the value of the REGION_HASH signal at the time of read_batch(). This aggregation should be used for signals that vary up and down over time such as the CPU frequency.
[in] | signal_name | Name of the signal to sample and aggregate. |
[in] | domain_type | Domain type over which the region hash and signal should be sampled. |
[in] | domain_idx | Domain over which the region hash and signal should be sampled. |
Implements geopm::SampleAggregator.
|
overridevirtual |
Push a signal to be accumulated per-region as a total.
The signal name must be a valid signal available through PlatformIO. Note that unlike other signals this is a total accumulated per region by subtracting the value of the signal at the region exit from the region entry. Region entry and exit are not exact and are determined by the value of the REGION_HASH signal at the time of read_batch(). This aggregation should only be used for signals that are monotonically increasing, such as time.
[in] | signal_name | Name of the signal to sample and aggregate. |
[in] | domain_type | Domain type over which the region hash and signal should be sampled. |
[in] | domain_idx | Domain over which the region hash and signal should be sampled. |
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal.
The aggregation type is determined by which method was used to push the signal: push_signal_total() or push_signal_average(). The value returned is aggregated over all samples since the application start.
[in] | signal_idx | Index returned by a previous call to push_signal_total() or push_signal_average(). |
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal since the first epoch.
The aggregation type is determined by which method was used to push the signal: push_signal_total() or push_signal_average(). The value returned is aggregated over all samples since the first epoch observed over the domain specified when the signal was pushed.
[in] | signal_idx | Index returned by a previous call to push_signal_total() or push_signal_average(). |
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal over the last completed epoch interval.
The aggregation type is determined by which method was used to push the signal: push_signal_total() or push_signal_average(). The value returned is aggregated over all samples between the last two samples when the epoch count changed.
[in] | signal_idx | Index returned by a previous call to push_signal_total() or push_signal_average(). |
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal during the last completed time interval.
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal during the execution of a particular region.
The aggregation type is determined by which method was used to push the signal: push_signal_total() or push_signal_average(). The value returned is aggregated over all samples where the REGION_HASH signal matched the value specified for the domain pushed. The returned value is zero for push_signal_total() aggregation, and NAN for push_signal_average() aggregation if the region was not observed for any samples.
[in] | signal_idx | Index returned by a previous call to push_signal_total() or push_signal_average(). |
[in] | region_hash | The region hash to look up data for. |
Implements geopm::SampleAggregator.
|
overridevirtual |
Get the aggregated value of a signal during the the last completed execution of a particular region.
The aggregation type is determined by which method was used to push the signal: push_signal_total() or push_signal_average(). The value returned is aggregated over the last contiguous set of samples where the REGION_HASH signal matched the value specified for the domain pushed. Note that if the region is currently executing, the value reported is aggregated over the last region interval, not the currently executing interval. The returned value is zero for push_signal_total() aggregation, and NAN for push_signal_average() aggregation if a completed region with the specified hash has not been observed.
[in] | signal_idx | Index returned by a previous call to push_signal_total() or push_signal_average(). |
[in] | region_hash | The region hash to look up data for. |
Implements geopm::SampleAggregator.
|
overridevirtual |
Update stored totals for each signal.
This method is to be called after each call to PlatformIO::read_batch(). This should be called with every PlatformIO update because sample_total() maybe not be called until the end of execution.
Implements geopm::SampleAggregator.