23 #if !defined _MONITOR_COLLECT_HPP_ 24 #define _MONITOR_COLLECT_HPP_ 42 inline void reset (
void);
59 template <
typename ... Args>
63 names.push_back (std::string (prefix) + basename);
79 template <
typename T = time_accumulator_statistic>
97 inline void time (
void);
101 inline std::size_t get_statistics_count (
void)
const;
106 inline void reset_timer ();
131 template <
class A = amount_accumulator_statistic,
class T = time_accumulator_statistic>
150 inline void time_and_increment (
const amount_rep &a = 1);
152 inline void reset_timer ();
155 inline std::size_t get_statistics_count (
void)
const;
193 template <
class A = amount_accumulator_statistic,
class T = time_accumulator_statistic,
class M = time_max_statistic>
200 inline void time_and_increment (
const amount_rep &a = 1);
203 inline std::size_t get_statistics_count (
void)
const;
240 template <
typename T>
292 : m_stat (timer_stat)
314 template <
class A,
class T>
317 , m_amount_statistic ()
318 , m_time_statistic ()
323 template <
class A,
class T>
331 template <
class A,
class T>
338 template <
class A,
class T>
345 template <
class A,
class T>
352 template <
class A,
class T>
356 std::size_t
index = 0;
367 template <
class A,
class T>
374 template <
class A,
class T>
381 template <
class A,
class T>
388 template <
class A,
class T>
394 const char *count_prefix =
"Num_";
395 const char *total_time_prefix =
"Total_time_";
396 const char *average_time_prefix =
"Avg_time_";
397 std::vector<std::string> names;
398 build_name_vector (names, basename, count_prefix, total_time_prefix, average_time_prefix);
401 assert (stat_count == names.size ());
411 template <
class A,
class T>
422 template <
class A,
class T>
436 template <
class A,
class T,
class M>
440 , m_total_time_statistic ()
441 , m_max_time_statistic ()
446 template <
class A,
class T,
class M>
455 template <
class A,
class T,
class M>
462 template <
class A,
class T,
class M>
471 template <
class A,
class T,
class M>
476 std::size_t
index = 0;
490 template <
class A,
class T,
class M>
497 template <
class A,
class T,
class M>
504 template <
class A,
class T,
class M>
511 template <
class A,
class T,
class M>
518 template <
class A,
class T,
class M>
524 const char *count_prefix =
"Num_";
525 const char *total_time_prefix =
"Total_time_";
526 const char *max_time_prefix =
"Max_time_";
527 const char *average_time_prefix =
"Avg_time_";
528 std::vector<std::string> names;
529 build_name_vector (names, basename, count_prefix, total_time_prefix, max_time_prefix, average_time_prefix);
532 assert (stat_count == names.size ());
567 #endif // _MONITOR_COLLECT_HPP_ void time_and_increment(const time_rep &d, const amount_rep &a=1)
void fetch(statistic_value *destination, fetch_mode mode=FETCH_GLOBAL) const
accumulator_statistic< time_rep > time_accumulator_statistic
counter_timer_statistic(void)
const fetch_mode FETCH_GLOBAL
time_rep get_time(fetch_mode mode=FETCH_GLOBAL) const
std::size_t get_statistics_count(void) const
std::uint64_t statistic_value
clock_type::duration duration
accumulator_atomic_statistic< time_rep > time_accumulator_atomic_statistic
std::chrono::high_resolution_clock clock_type
void fetch(statistic_value *destination, fetch_mode mode=FETCH_GLOBAL) const
amount_rep get_count(fetch_mode mode=FETCH_GLOBAL) const
void register_to_monitor(monitor &mon, const char *basename) const
static T_FETCH_FUNC fetch_func[]
void time(const time_rep &d)
time_rep get_average_time(fetch_mode mode=FETCH_GLOBAL) const
clock_type::time_point time_point
accumulator_atomic_statistic< amount_rep > amount_accumulator_atomic_statistic
static enum scanner_mode mode
void fetch(statistic_value *destination, fetch_mode mode=FETCH_GLOBAL) const
std::size_t get_statistics_count(void) const
static void get_time(struct timeval *start_time, char *time, int buf_len)
amount_rep get_count(fetch_mode mode=FETCH_GLOBAL) const
std::size_t get_statistics_count(void) const
time_rep get_max_time(fetch_mode mode=FETCH_GLOBAL) const
time_rep get_time(fetch_mode mode=FETCH_GLOBAL) const
statistic_value statistic_value_cast(const amount_rep &rep)
char * basename(const char *path)
counter_timer_statistic & m_stat
void register_to_monitor(monitor &mon, const char *basename) const
void build_name_vector(std::vector< std::string > &names, const char *basename, const char *prefix)
counter_timer_max_statistic(void)
time_rep get_average_time(fetch_mode mode=FETCH_GLOBAL) const
accumulator_statistic< amount_rep > amount_accumulator_statistic
void time_and_increment(const time_rep &d, const amount_rep &a=1)
void register_statistics(std::size_t statistics_count, const fetch_function &fetch_f, const std::vector< std::string > &names)
time_rep get_time(fetch_mode mode=FETCH_GLOBAL) const