#include <d2/d2_queue_mgr.h>
#include <d2srv/d2_log.h>
#include <dhcp_ddns/ncr_udp.h>
+#include <stats/stats_mgr.h>
+
+using namespace isc::stats;
namespace isc {
namespace d2 {
// is no receive in progress.
LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_QUEUE_FULL)
.arg(max_queue_size_);
+ StatsMgr::instance().addValue("queue-mgr-queue-full", static_cast<int64_t>(1));
stopListening(STOPPED_QUEUE_FULL);
break;
StatMap stats_ncr = {
{ "ncr-received", 3},
{ "ncr-invalid", 0},
- { "ncr-error", 0}
+ { "ncr-error", 0},
+ { "queue-mgr-queue-full", 0}
};
checkStats(stats_ncr);
StatMap stats_ncr_new = {
{ "ncr-received", 6},
{ "ncr-invalid", 0},
- { "ncr-error", 0}
+ { "ncr-error", 0},
+ { "queue-mgr-queue-full", 0}
};
checkStats(stats_ncr_new);
EXPECT_NO_THROW(io_service_->runOne());
EXPECT_EQ(D2QueueMgr::STOPPED_QUEUE_FULL, queue_mgr_->getMgrState());
+ StatMap stats_ncr_full = {
+ { "ncr-received", 7},
+ { "ncr-invalid", 0},
+ { "ncr-error", 0},
+ { "queue-mgr-queue-full", 1}
+ };
+ checkStats(stats_ncr_full);
+
// Verify queue size did not increase beyond max.
EXPECT_EQ(VALID_MSG_CNT, queue_mgr_->getQueueSize());