geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
SampleAggregator.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef SAMPLEAGGREGATOR_HPP_INCLUDE
7 #define SAMPLEAGGREGATOR_HPP_INCLUDE
8 
9 #include <cstdint>
10 #include <memory>
11 #include <set>
12 #include <string>
13 
14 #include "geopm_public.h"
15 
16 namespace geopm
17 {
18  class GEOPM_PUBLIC SampleAggregator
19  {
20  public:
23  static std::unique_ptr<SampleAggregator> make_unique(void);
25  virtual ~SampleAggregator() = default;
43  virtual int push_signal(const std::string &signal_name,
44  int domain_type,
45  int domain_idx) = 0;
71  virtual int push_signal_total(const std::string &signal_name,
72  int domain_type,
73  int domain_idx) = 0;
99  virtual int push_signal_average(const std::string &signal_name,
100  int domain_type,
101  int domain_idx) = 0;
108  virtual void update(void) = 0;
123  virtual double sample_application(int signal_idx) = 0;
141  virtual double sample_epoch(int signal_idx) = 0;
165  virtual double sample_region(int signal_idx, uint64_t region_hash) = 0;
182  virtual double sample_epoch_last(int signal_idx) = 0;
211  virtual double sample_region_last(int signal_idx, uint64_t region_hash) = 0;
230  virtual void period_duration(double duration) = 0;
243  virtual int get_period(void) = 0;
246  virtual double sample_period_last(int signal_idx) = 0;
247  protected:
248  SampleAggregator() = default;
249  };
250 }
251 
252 #endif
Definition: SampleAggregator.hpp:19
virtual int push_signal_average(const std::string &signal_name, int domain_type, int domain_idx)=0
Push a signal to be accumulated per-region as an average.
virtual double sample_epoch(int signal_idx)=0
Get the aggregated value of a signal since the first epoch.
virtual int get_period(void)=0
Get the index of the current time period.
virtual ~SampleAggregator()=default
Default destructor of pure virtual base.
virtual int push_signal_total(const std::string &signal_name, int domain_type, int domain_idx)=0
Push a signal to be accumulated per-region as a total.
virtual double sample_application(int signal_idx)=0
Get the aggregated value of a signal.
virtual double sample_region(int signal_idx, uint64_t region_hash)=0
Get the aggregated value of a signal during the execution of a particular region.
virtual double sample_period_last(int signal_idx)=0
Get the aggregated value of a signal during the last completed time interval.
virtual double sample_region_last(int signal_idx, uint64_t region_hash)=0
Get the aggregated value of a signal during the the last completed execution of a particular region.
virtual void update(void)=0
Update stored totals for each signal.
virtual void period_duration(double duration)=0
Set the time period for sample_period_last()
virtual double sample_epoch_last(int signal_idx)=0
Get the aggregated value of a signal over the last completed epoch interval.
virtual int push_signal(const std::string &signal_name, int domain_type, int domain_idx)=0
Push a signal to be accumulated per-region.
Definition: Accumulator.cpp:12