15 #ifndef CORE_UTIL_TIMING_AGGREGATOR_H_
16 #define CORE_UTIL_TIMING_AGGREGATOR_H_
35 void AddEntry(
const std::string& key, int64_t value) {
37 std::vector<int64_t> data;
38 data.push_back(value);
55 std::map<std::string, std::vector<int64_t>>
timings_;
66 os <<
"\033[1mTotal execution time per operation\033[0m" << std::endl;
68 os << timing.first <<
": "
69 << std::accumulate(timing.second.begin(), timing.second.end(), 0)
73 os <<
"No statistics were gathered!" << std::endl;
friend std::ostream & operator<<(std::ostream &os, const TimingAggregator &p)
BDM_CLASS_DEF_NV(TimingAggregator, 1)
~TimingAggregator()=default
int operator[](std::string idx)
std::vector< std::string > descriptions_
TimingAggregator()=default
void AddDescription(const std::string &text)
std::map< std::string, std::vector< int64_t > > timings_
void AddEntry(const std::string &key, int64_t value)
std::ostream & operator<<(std::ostream &o, const MathArray< T, N > &arr)