1#ifndef TRIGGER_PLUGINS_LIVETIMECOUNTER_HPP_
2#define TRIGGER_PLUGINS_LIVETIMECOUNTER_HPP_
LivetimeCounter counts the total time in milliseconds spent in each of the available states.
uint64_t state_time_t
A type to store a time duration in milliseconds.
std::map< State, state_time_t > m_state_times
state_time_t m_last_state_change_time
LivetimeCounter(State state)
Construct a LivetimeCounter in the given state.
std::string get_state_name(State state) const
std::string get_report_string()
Get a nicely-formatted string of the time spent in each state.
std::map< State, state_time_t > get_time_map()
Get a map of accumulated time in milliseconds in each state.
void set_state(State state)
Set the current state to state.
state_time_t get_time(State state)
Get the accumulated time in milliseconds spent in a particular state.