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
14#ifndef HLCC_TRKSIM_EXECUTION_STATISTICS_HPP
15#define HLCC_TRKSIM_EXECUTION_STATISTICS_HPP
16
17#include<string>
18#include<chrono>
19#include<vector>
20
21#include<boost/circular_buffer.hpp>
22
23
24namespace hlcc::trksim {
25
33public:
39 uint64_t average_ns;
40 uint64_t lowest_ns;
41 uint64_t highest_ns;
42 uint64_t samples_nbr;
43 };
44
54
61 ExecTimeStats(std::string p_name, uint16_t p_buf_size);
62
68 void TimerStart();
69
75 void TimerStop();
76
81 std::string GetName() {return m_stats_name;};
82
87 StatisticsData GetStatsData();
88
93 std::string PrintStats();
94
100 static std::string PrintCollection(const std::vector<StatisticsCollection> &collection);
101
106 static std::string DurationAsString(uint64_t time_ns);
107
108private:
109 /* Name given to the current stats instance*/
110 std::string m_stats_name;
111 /* Buffer to store the timer data for multiple iterations */
112 boost::circular_buffer<uint64_t> m_buf_elapsed_ns;
113 /* Durations variables to hold the current iteration data*/
114 std::chrono::nanoseconds m_start;
115 std::chrono::nanoseconds m_stop;
116};
117
118} // namespace hlcc::trksim
119
120
121#endif // HLCC_TRKSIM_EXECUTION_STATISTICS_HPP
Definition executionStatistics.hpp:32
static std::string DurationAsString(uint64_t time_ns)
Definition executionStatistics.cpp:168
void TimerStop()
Definition executionStatistics.cpp:42
StatisticsData GetStatsData()
Definition executionStatistics.cpp:61
ExecTimeStats(std::string p_name, uint16_t p_buf_size)
Definition executionStatistics.cpp:25
std::string GetName()
Definition executionStatistics.hpp:81
void TimerStart()
Definition executionStatistics.cpp:32
static std::string PrintCollection(const std::vector< StatisticsCollection > &collection)
Definition executionStatistics.cpp:123
std::string PrintStats()
Definition executionStatistics.cpp:102
Definition actionMgr.cpp:35
Definition executionStatistics.hpp:49
StatisticsData py_data
Definition executionStatistics.hpp:52
StatisticsData cpp_data
Definition executionStatistics.hpp:51
std::string name
Definition executionStatistics.hpp:50
Definition executionStatistics.hpp:38
uint64_t lowest_ns
Definition executionStatistics.hpp:40
uint64_t highest_ns
Definition executionStatistics.hpp:41
uint64_t average_ns
Definition executionStatistics.hpp:39
uint64_t samples_nbr
Definition executionStatistics.hpp:42