[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 723837a..35a8f55 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -192,6 +192,7 @@
{
NFD_LOG_DEBUG("onContentStoreMiss interest=" << interest.getName());
++m_counters.nCsMisses;
+ afterCsMiss(interest);
// attach HopLimit if configured and not present in Interest
if (m_config.defaultHopLimit > 0 && !interest.getHopLimit()) {
@@ -235,6 +236,7 @@
{
NFD_LOG_DEBUG("onContentStoreHit interest=" << interest.getName());
++m_counters.nCsHits;
+ afterCsHit(interest, data);
data.setTag(make_shared<lp::IncomingFaceIdTag>(face::FACEID_CONTENT_STORE));
data.setTag(interest.getTag<lp::PitToken>());
diff --git a/daemon/fw/forwarder.hpp b/daemon/fw/forwarder.hpp
index a96448b..826c79a 100644
--- a/daemon/fw/forwarder.hpp
+++ b/daemon/fw/forwarder.hpp
@@ -142,6 +142,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
* \param interest the incoming Interest, must be well-formed and created with make_shared