MXS-2537 Turn 'cluster_monitor_interval' into duration

This commit is contained in:
Johan Wikman
2019-05-31 15:52:55 +03:00
parent 62a9d4f8c1
commit 69dea5a81e
2 changed files with 9 additions and 2 deletions

View File

@ -208,6 +208,8 @@ ClustrixMonitor* ClustrixMonitor::create(const string& name, const string& modul
return pThis;
}
using std::chrono::milliseconds;
bool ClustrixMonitor::configure(const MXS_CONFIG_PARAMETER* pParams)
{
if (!MonitorWorker::configure(pParams))
@ -220,7 +222,8 @@ bool ClustrixMonitor::configure(const MXS_CONFIG_PARAMETER* pParams)
m_health_urls.clear();
m_nodes_by_id.clear();
m_config.set_cluster_monitor_interval(pParams->get_integer(CLUSTER_MONITOR_INTERVAL_NAME));
long interval = pParams->get_duration<milliseconds>(CLUSTER_MONITOR_INTERVAL_NAME).count();
m_config.set_cluster_monitor_interval(interval);
m_config.set_health_check_threshold(pParams->get_integer(HEALTH_CHECK_THRESHOLD_NAME));
m_config.set_dynamic_node_detection(pParams->get_bool(DYNAMIC_NODE_DETECTION_NAME));
m_config.set_health_check_port(pParams->get_integer(HEALTH_CHECK_PORT_NAME));