[ndnSIM] fw: Add signals to monitor Hits/Misses of the CS
Change-Id: Ifde5ce3311716ffa1aecc7312704328ac0447ae7
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 1fc674d..b94108f 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -176,6 +176,7 @@
{
NFD_LOG_DEBUG("onContentStoreMiss interest=" << interest.getName());
++m_counters.nCsMisses;
+ afterCsMiss(interest);
// insert in-record
pitEntry->insertOrUpdateInRecord(ingress.face, interest);
@@ -216,6 +217,7 @@
{
NFD_LOG_DEBUG("onContentStoreHit interest=" << interest.getName());
++m_counters.nCsHits;
+ afterCsHit(interest, data);
data.setTag(make_shared<lp::IncomingFaceIdTag>(face::FACEID_CONTENT_STORE));
// FIXME Should we lookup PIT for other Interests that also match the data?
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index 39cc0b8..3b28a26 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -176,6 +176,14 @@
*/
signal::Signal<Forwarder, pit::Entry> beforeExpirePendingInterest;
+ /** \brief Signals when the incoming interest pipeline gets a hit from the content store
+ */
+ signal::Signal<Forwarder, Interest, Data> afterCsHit;
+
+ /** \brief Signals when the incoming interest pipeline gets a miss from the content store
+ */
+ signal::Signal<Forwarder, Interest> afterCsMiss;
+
PUBLIC_WITH_TESTS_ELSE_PRIVATE: // pipelines
/** \brief incoming Interest pipeline
*/