tools: display satisfied and unsatisfied interests counters
refs: #4720
Change-Id: I69c2400a558997ff48f2b66883cc680dc497360a
diff --git a/tools/nfd-status-http-server-files/nfd-status.xsl b/tools/nfd-status-http-server-files/nfd-status.xsl
index d9a996c..0b50985 100644
--- a/tools/nfd-status-http-server-files/nfd-status.xsl
+++ b/tools/nfd-status-http-server-files/nfd-status.xsl
@@ -112,6 +112,8 @@
<th>Out Data</th>
<th>In Nacks</th>
<th>Out Nacks</th>
+ <th>Satisfied Interests</th>
+ <th>Unsatisfied Interests</th>
</tr>
</thead>
<tbody>
@@ -131,6 +133,8 @@
<td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nData"/></td>
<td><xsl:value-of select="nfd:packetCounters/nfd:incomingPackets/nfd:nNacks"/></td>
<td><xsl:value-of select="nfd:packetCounters/nfd:outgoingPackets/nfd:nNacks"/></td>
+ <td><xsl:value-of select="nfd:packetCounters/nfd:nSatisfiedInterests"/></td>
+ <td><xsl:value-of select="nfd:packetCounters/nfd:nUnsatisfiedInterests"/></td>
</tr>
</tbody>
</table>
diff --git a/tools/nfdc/forwarder-general-module.cpp b/tools/nfdc/forwarder-general-module.cpp
index e0d6b1b..417b346 100644
--- a/tools/nfdc/forwarder-general-module.cpp
+++ b/tools/nfdc/forwarder-general-module.cpp
@@ -88,6 +88,9 @@
<< "</outgoingPackets>";
os << "</packetCounters>";
+ os << "<nSatisfiedInterests>" << item.getNSatisfiedInterests() << "</nSatisfiedInterests>";
+ os << "<nUnsatisfiedInterests>" << item.getNUnsatisfiedInterests() << "</nUnsatisfiedInterests>";
+
os << "</generalStatus>";
}
@@ -102,7 +105,7 @@
void
ForwarderGeneralModule::formatItemText(std::ostream& os, const ForwarderStatus& item)
{
- text::ItemAttributes ia(true, 20);
+ text::ItemAttributes ia(true, 21);
os << ia("version") << item.getNfdVersion()
<< ia("startTime") << text::formatTimestamp(item.getStartTimestamp())
@@ -120,7 +123,9 @@
<< ia("nInData") << item.getNInData()
<< ia("nOutData") << item.getNOutData()
<< ia("nInNacks") << item.getNInNacks()
- << ia("nOutNacks") << item.getNOutNacks();
+ << ia("nOutNacks") << item.getNOutNacks()
+ << ia("nSatisfiedInterests") << item.getNSatisfiedInterests()
+ << ia("nUnsatisfiedInterests") << item.getNUnsatisfiedInterests();
os << ia.end();
}