MXS-1775 Monitor loop and monitoring separated
In preparation for moving the monitor loop to MonitorInstance.
This commit is contained in:
@ -192,12 +192,8 @@ void GRMon::main()
|
||||
lock_monitor_servers(m_monitor);
|
||||
servers_status_pending_to_current(m_monitor);
|
||||
|
||||
for (MXS_MONITORED_SERVER *ptr = m_monitor->monitored_servers; ptr; ptr = ptr->next)
|
||||
{
|
||||
update_server_status(m_monitor, ptr);
|
||||
}
|
||||
tick();
|
||||
|
||||
mon_hangup_failed_servers(m_monitor);
|
||||
/**
|
||||
* After updating the status of all servers, check if monitor events
|
||||
* need to be launched.
|
||||
@ -206,6 +202,7 @@ void GRMon::main()
|
||||
m_script.empty() ? NULL : m_script.c_str(),
|
||||
m_events);
|
||||
|
||||
mon_hangup_failed_servers(m_monitor);
|
||||
servers_status_current_to_pending(m_monitor);
|
||||
store_server_journal(m_monitor, NULL);
|
||||
release_monitor_servers(m_monitor);
|
||||
@ -225,6 +222,14 @@ void GRMon::main()
|
||||
}
|
||||
}
|
||||
|
||||
void GRMon::tick()
|
||||
{
|
||||
for (MXS_MONITORED_SERVER *ptr = m_monitor->monitored_servers; ptr; ptr = ptr->next)
|
||||
{
|
||||
update_server_status(m_monitor, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
|
||||
@ -39,6 +39,7 @@ private:
|
||||
|
||||
bool has_sufficient_permissions() const;
|
||||
void configure(const MXS_CONFIG_PARAMETER* params);
|
||||
void tick();
|
||||
|
||||
void main();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user