1 #ifndef HEARTBEAT_CLASS
2 #define HEARTBEAT_CLASS
36 heartbeat(
int misses_allowed = 500,
int check_interval = 10000);
52 void reset(
int misses_allowed,
int check_interval);
108 void reset_next_beat();
Provides a dynamically resizable ASCII character string.
Monitors a periodic heartbeat to track a resource's health.
void made_request()
records that another heartbeat request was sent out.
void recycle()
a synonym for kabump().
int misses_left() const
the number of misses that this object is still allowed.
int checking_interval() const
returns the period of the heartbeats.
heartbeat & operator=(const heartbeat &to_copy)
int allowed_misses() const
returns the number of misses allowed overall.
timely::time_stamp heartbeat_time() const
returns the time when the next heartbeat will be requested.
void reset(int misses_allowed, int check_interval)
retrains the heartbeat monitor for a new configuration.
bool due() const
is the next heartbeat due yet?
int missed_so_far() const
returns the number of heartbeat responses that are pending.
int time_left() const
number of milliseconds left before the next beat will be requested.
heartbeat(int misses_allowed=500, int check_interval=10000)
creates a heartbeat monitor with the specified interval and maximum skips permitted.
bool dead() const
is this object considered dead from missing too many heartbeats?
basis::astring text_form(bool detailed=false) const
returns a readable form of the heartbeat's information.
DEFINE_CLASS_NAME("heartbeat")
void need_beat()
a synonym for the made_request() method.
void kabump()
registers a heartbeat response and sets the state to healthy.
Represents a point in time relative to the operating system startup time.