Checkpoint. Enabling nacks back, "reverting" count statistics on nacks
diff --git a/utils/stats/load-stats-node.cc b/utils/stats/load-stats-node.cc
index 39e9d60..743f764 100644
--- a/utils/stats/load-stats-node.cc
+++ b/utils/stats/load-stats-node.cc
@@ -93,6 +93,26 @@
}
void
+LoadStatsNode::RemoveFromStats ()
+{
+ m_pit.count ()--;
+
+ for (stats_container::iterator item = m_incoming.begin ();
+ item != m_incoming.end ();
+ item ++)
+ {
+ item->second.count ()--;
+ }
+
+ for (stats_container::iterator item = m_outgoing.begin ();
+ item != m_outgoing.end ();
+ item ++)
+ {
+ item->second.count ()--;
+ }
+}
+
+void
LoadStatsNode::Timeout ()
{
m_pit.unsatisfied ()++;
diff --git a/utils/stats/load-stats-node.h b/utils/stats/load-stats-node.h
index 365db55..135c5f0 100644
--- a/utils/stats/load-stats-node.h
+++ b/utils/stats/load-stats-node.h
@@ -71,6 +71,12 @@
Satisfy ();
/**
+ * Remove a packet from all stats
+ */
+ void
+ RemoveFromStats ();
+
+ /**
* Increment counter to both incoming and outgoing lists, for all faces
*/
void
diff --git a/utils/stats/load-stats.cc b/utils/stats/load-stats.cc
index d785845..4bc1e5b 100644
--- a/utils/stats/load-stats.cc
+++ b/utils/stats/load-stats.cc
@@ -66,6 +66,13 @@
}
LoadStats &
+LoadStats::operator -- (int)
+{
+ counter_ --;
+ return *this;
+}
+
+LoadStats &
LoadStats::operator += (uint32_t amount)
{
counter_ += amount;
diff --git a/utils/stats/load-stats.h b/utils/stats/load-stats.h
index 3e71753..d07c548 100644
--- a/utils/stats/load-stats.h
+++ b/utils/stats/load-stats.h
@@ -45,6 +45,9 @@
LoadStats &
operator ++ (int);
+
+ LoadStats &
+ operator -- (int);
// uint32_t
// GetCounter () const;
diff --git a/utils/stats/stats-tree.cc b/utils/stats/stats-tree.cc
index f84d902..f27281a 100644
--- a/utils/stats/stats-tree.cc
+++ b/utils/stats/stats-tree.cc
@@ -79,6 +79,14 @@
}
void
+StatsTree::RemoveFromStats (const NameComponents &key)
+{
+ std::pair<tree_type::iterator, bool> item = m_tree.insert (key, LoadStatsNode ());
+
+ item.first->payload ().RemoveFromStats ();
+}
+
+void
StatsTree::Timeout (const NameComponents &key)
{
std::pair<tree_type::iterator, bool> item = m_tree.insert (key, LoadStatsNode ());
diff --git a/utils/stats/stats-tree.h b/utils/stats/stats-tree.h
index 955f798..bcab66d 100644
--- a/utils/stats/stats-tree.h
+++ b/utils/stats/stats-tree.h
@@ -54,6 +54,9 @@
Satisfy (const NameComponents &key);
void
+ RemoveFromStats (const NameComponents &key);
+
+ void
Timeout (const NameComponents &key);
void