" }",
" }",
" }",
- " ]",
+ " ],",
+ " \"multi-threading-enabled\": true,",
+ " \"thread-pool-size\": 4,",
+ " \"packet-queue-size\": 64",
" }",
"}"
],
* remote: for the remote server the last known state, served
HA scopes and the role of the server in HA relationship.
-The ``high-availability`` information is only returned when the command is
+ - multi-threading-enabled: flag indicating if multi-threading is enabled.
+
+ - thread-pool-size: number of dhcp service threads.
+
+ - packet-queue-size: size of the packet queue size.
+
+The ``high-availability`` information is returned only when the command is
sent to the DHCP servers being in the HA setup. This parameter is
never returned when the ``status-get`` command is sent to the
Control Agent or DDNS deamon.
+The ``thread-pool-size`` and ``packet-queue-size`` information is returned only
+when the command is send to DHCP servers with multi-threading enabled. This
+parameter is never returned when the ``status-get`` command is sent to the
+Control Agent or DDNS deamon.
+
To learn more about the HA status information returned by the
``status-get`` command please refer to the the :ref:`command-ha-status-get`
section.
}
}
}
- ]
+ ],
+ "multi-threading-enabled": true,
+ "thread-pool-size": 4,
+ "packet-queue-size": 64
}
}
}
if (MultiThreadingMgr::instance().getMode()) {
- status->set("thread-pool-size", Element::create(
- long(MultiThreadingMgr::instance().getThreadPoolSize())));
- status->set("packet-queue-size", Element::create(
- long(MultiThreadingMgr::instance().getPacketQueueSize())));
+ status->set("multi-threading-enabled", Element::create(true));
+ status->set("thread-pool-size", Element::create(static_cast<int32_t>(
+ MultiThreadingMgr::instance().getThreadPoolSize())));
+ status->set("packet-queue-size", Element::create(static_cast<int32_t>(
+ MultiThreadingMgr::instance().getPacketQueueSize())));
+ } else {
+ status->set("multi-threading-enabled", Element::create(false));
}
return (createAnswer(0, status));
EXPECT_LE(found_reload->intValue(), 5);
EXPECT_GE(found_reload->intValue(), 0);
+ auto found_multi_threading = arguments->get("multi-threading-enabled");
+ ASSERT_TRUE(found_multi_threading);
+ EXPECT_EQ(false, found_multi_threading->boolValue());
+
+ auto found_thread_count = arguments->get("thread-pool-size");
+ ASSERT_FALSE(found_thread_count);
+
+ auto found_queue_size = arguments->get("packet-queue-size");
+ ASSERT_FALSE(found_queue_size);
+
MultiThreadingMgr::instance().setMode(true);
MultiThreadingMgr::instance().setThreadPoolSize(4);
MultiThreadingMgr::instance().setPacketQueueSize(64);
EXPECT_LE(found_reload->intValue(), 5);
EXPECT_GE(found_reload->intValue(), 0);
- auto found_thread_count = arguments->get("thread-pool-size");
+ found_multi_threading = arguments->get("multi-threading-enabled");
+ ASSERT_TRUE(found_multi_threading);
+ EXPECT_EQ(true, found_multi_threading->boolValue());
+
+ found_thread_count = arguments->get("thread-pool-size");
ASSERT_TRUE(found_thread_count);
EXPECT_EQ(found_thread_count->intValue(), 4);
- auto found_queue_size = arguments->get("packet-queue-size");
+ found_queue_size = arguments->get("packet-queue-size");
ASSERT_TRUE(found_queue_size);
EXPECT_EQ(found_queue_size->intValue(), 64);
}
}
if (MultiThreadingMgr::instance().getMode()) {
- status->set("thread-pool-size", Element::create(
- long(MultiThreadingMgr::instance().getThreadPoolSize())));
- status->set("packet-queue-size", Element::create(
- long(MultiThreadingMgr::instance().getPacketQueueSize())));
+ status->set("multi-threading-enabled", Element::create(true));
+ status->set("thread-pool-size", Element::create(static_cast<int32_t>(
+ MultiThreadingMgr::instance().getThreadPoolSize())));
+ status->set("packet-queue-size", Element::create(static_cast<int32_t>(
+ MultiThreadingMgr::instance().getPacketQueueSize())));
+ } else {
+ status->set("multi-threading-enabled", Element::create(false));
}
return (createAnswer(0, status));
EXPECT_LE(found_reload->intValue(), 5);
EXPECT_GE(found_reload->intValue(), 0);
+ auto found_multi_threading = arguments->get("multi-threading-enabled");
+ ASSERT_TRUE(found_multi_threading);
+ EXPECT_EQ(false, found_multi_threading->boolValue());
+
+ auto found_thread_count = arguments->get("thread-pool-size");
+ ASSERT_FALSE(found_thread_count);
+
+ auto found_queue_size = arguments->get("packet-queue-size");
+ ASSERT_FALSE(found_queue_size);
+
MultiThreadingMgr::instance().setMode(true);
MultiThreadingMgr::instance().setThreadPoolSize(4);
MultiThreadingMgr::instance().setPacketQueueSize(64);
EXPECT_LE(found_reload->intValue(), 5);
EXPECT_GE(found_reload->intValue(), 0);
- auto found_thread_count = arguments->get("thread-pool-size");
+ found_multi_threading = arguments->get("multi-threading-enabled");
+ ASSERT_TRUE(found_multi_threading);
+ EXPECT_EQ(true, found_multi_threading->boolValue());
+
+ found_thread_count = arguments->get("thread-pool-size");
ASSERT_TRUE(found_thread_count);
EXPECT_EQ(found_thread_count->intValue(), 4);
- auto found_queue_size = arguments->get("packet-queue-size");
+ found_queue_size = arguments->get("packet-queue-size");
ASSERT_TRUE(found_queue_size);
EXPECT_EQ(found_queue_size->intValue(), 64);
}