HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
executionStatistics.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020-2025 European Southern Observatory (ESO)
2//
3// SPDX-License-Identifier: LGPL-3.0-only
4
13// !!! We are leave this class for now but we should think and decide if we want to keep it
14
15#ifndef HLCC_PFSSIMHLCC_EXECUTION_STATISTICS_HPP
16#define HLCC_PFSSIMHLCC_EXECUTION_STATISTICS_HPP
17
18#include<string>
19#include<chrono>
20#include<vector>
21
22#include<boost/circular_buffer.hpp>
23
24
25namespace hlcc::pfssimhlcc {
26
34public:
40 uint64_t average_ns;
41 uint64_t lowest_ns;
42 uint64_t highest_ns;
43 uint64_t samples_nbr;
44 };
45
55
62 ExecTimeStats(std::string p_name, uint16_t p_buf_size);
63
69 void TimerStart();
70
76 void TimerStop();
77
82 std::string GetName() {return m_stats_name;};
83
88 StatisticsData GetStatsData();
89
94 std::string PrintStats();
95
101 static std::string PrintCollection(const std::vector<StatisticsCollection> &collection);
102
107 static std::string DurationAsString(uint64_t time_ns);
108
109private:
110 /* Name given to the current stats instance*/
111 std::string m_stats_name;
112 /* Buffer to store the timer data for multiple iterations */
113 boost::circular_buffer<uint64_t> m_buf_elapsed_ns;
114 /* Durations variables to hold the current iteration data*/
115 std::chrono::nanoseconds m_start;
116 std::chrono::nanoseconds m_stop;
117};
118
119} // namespace hlcc::pfssimhlcc
120
121
122#endif // HLCC_PFSSIMHLCC_EXECUTION_STATISTICS_HPP
Definition executionStatistics.hpp:33
static std::string PrintCollection(const std::vector< StatisticsCollection > &collection)
Definition executionStatistics.cpp:123
void TimerStart()
Definition executionStatistics.cpp:32
static std::string DurationAsString(uint64_t time_ns)
Definition executionStatistics.cpp:168
std::string PrintStats()
Definition executionStatistics.cpp:102
ExecTimeStats(std::string p_name, uint16_t p_buf_size)
Definition executionStatistics.cpp:25
void TimerStop()
Definition executionStatistics.cpp:42
std::string GetName()
Definition executionStatistics.hpp:82
StatisticsData GetStatsData()
Definition executionStatistics.cpp:61
Definition actionMgr.cpp:34
Definition executionStatistics.hpp:50
StatisticsData cpp_data
Definition executionStatistics.hpp:52
StatisticsData py_data
Definition executionStatistics.hpp:53
std::string name
Definition executionStatistics.hpp:51
Definition executionStatistics.hpp:39
uint64_t highest_ns
Definition executionStatistics.hpp:42
uint64_t samples_nbr
Definition executionStatistics.hpp:43
uint64_t lowest_ns
Definition executionStatistics.hpp:41
uint64_t average_ns
Definition executionStatistics.hpp:40