6 #ifndef SAMPLEAGGREGATORIMP_HPP_INCLUDE
7 #define SAMPLEAGGREGATORIMP_HPP_INCLUDE
28 int domain_idx)
override;
31 int domain_idx)
override;
34 int domain_idx)
override;
35 void update(
void)
override;
38 double sample_region(
int signal_idx, uint64_t region_hash)
override;
47 struct m_sum_signal_s {
53 uint64_t region_hash_last;
59 std::shared_ptr<SumAccumulator> app_accum;
61 std::shared_ptr<SumAccumulator> epoch_accum;
63 std::shared_ptr<SumAccumulator> period_accum;
65 std::map<uint64_t, std::shared_ptr<SumAccumulator> > region_accum;
67 std::map<uint64_t, std::shared_ptr<SumAccumulator> >::iterator region_accum_it;
71 struct m_avg_signal_s {
77 uint64_t region_hash_last;
83 std::shared_ptr<AvgAccumulator> app_accum;
85 std::shared_ptr<AvgAccumulator> epoch_accum;
87 std::shared_ptr<AvgAccumulator> period_accum;
89 std::map<uint64_t, std::shared_ptr<AvgAccumulator> > region_accum;
91 std::map<uint64_t, std::shared_ptr<AvgAccumulator> >::iterator region_accum_it;
94 void update_total(
void);
95 void update_average(
void);
96 double sample_epoch_helper(
int signal_idx,
bool is_last);
97 double sample_region_helper(
int signal_idx, uint64_t region_hash,
bool is_last);
98 uint64_t sample_to_hash(
double sample);
100 PlatformIO &m_platform_io;
106 std::map<int, m_sum_signal_s> m_sum_signal;
109 std::map<int, m_avg_signal_s> m_avg_signal;
110 double m_period_duration;
Definition: SampleAggregator.hpp:19
Definition: SampleAggregatorImp.hpp:22
int get_period(void) override
Get the index of the current time period.
Definition: SampleAggregator.cpp:214
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.
Definition: SampleAggregator.cpp:435
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.
Definition: SampleAggregator.cpp:105
double sample_epoch(int signal_idx) override
Get the aggregated value of a signal since the first epoch.
Definition: SampleAggregator.cpp:446
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.
Definition: SampleAggregator.cpp:73
void update(void) override
Update stored totals for each signal.
Definition: SampleAggregator.cpp:322
SampleAggregatorImp()
Definition: SampleAggregator.cpp:26
void period_duration(double duration) override
Set the time period for sample_period_last()
Definition: SampleAggregator.cpp:205
int push_signal(const std::string &signal_name, int domain_type, int domain_idx) override
Push a signal to be accumulated per-region.
Definition: SampleAggregator.cpp:42
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.
Definition: SampleAggregator.cpp:421
double sample_application(int signal_idx) override
Get the aggregated value of a signal.
Definition: SampleAggregator.cpp:330
double sample_period_last(int signal_idx) override
Get the aggregated value of a signal during the last completed time interval.
Definition: SampleAggregator.cpp:462
double sample_epoch_last(int signal_idx) override
Get the aggregated value of a signal over the last completed epoch interval.
Definition: SampleAggregator.cpp:454
Definition: Accumulator.cpp:12