diff --git a/Documentation/Monitors/Clustrix-Monitor.md b/Documentation/Monitors/Clustrix-Monitor.md index f0b70a917..9fcdcb2fc 100644 --- a/Documentation/Monitors/Clustrix-Monitor.md +++ b/Documentation/Monitors/Clustrix-Monitor.md @@ -87,8 +87,12 @@ entire cluster. The default value is 60000 (1 minute), which should not be lowered as that may have an adverse effect on the Cluster itself. ``` -cluster_monitor_interval=120000 +cluster_monitor_interval=120000ms ``` +The interval is specified as documented +[here](../Getting-Started/Configuration-Guide.md#durations). If no explicit unit +is provided, the value is interpreted as milliseconds in MaxScale 2.4. In subsequent +versions a value without a unit may be rejected. ### `health_check_threshold` diff --git a/server/modules/monitor/clustrixmon/clustrixmonitor.cc b/server/modules/monitor/clustrixmon/clustrixmonitor.cc index 7f67f5c23..3db5d839e 100644 --- a/server/modules/monitor/clustrixmon/clustrixmonitor.cc +++ b/server/modules/monitor/clustrixmon/clustrixmonitor.cc @@ -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(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));