mgmt: add satisfied and unsatisfied counters for forwarder status management
refs: #4720
Change-Id: I69545e0fbf4ebba75a292644631c2cf9fdaa301a
diff --git a/daemon/fw/forwarder-counters.hpp b/daemon/fw/forwarder-counters.hpp
index 5a63406..ca9eb4d 100644
--- a/daemon/fw/forwarder-counters.hpp
+++ b/daemon/fw/forwarder-counters.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,6 +41,8 @@
PacketCounter nOutData;
PacketCounter nInNacks;
PacketCounter nOutNacks;
+ PacketCounter nSatisfiedInterests;
+ PacketCounter nUnsatisfiedInterests;
PacketCounter nCsHits;
PacketCounter nCsMisses;
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 7e28db2..d55da5a 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -246,6 +246,14 @@
// Dead Nonce List insert if necessary
this->insertDeadNonceList(*pitEntry, 0);
+ // Increment satisfied/unsatisfied Interests counter
+ if (pitEntry->isSatisfied) {
+ ++m_counters.nSatisfiedInterests;
+ }
+ else {
+ ++m_counters.nUnsatisfiedInterests;
+ }
+
// PIT delete
scheduler::cancel(pitEntry->expiryTimer);
m_pit.erase(pitEntry.get());