29 #include <ndn-cxx/mgmt/nfd/status-dataset.hpp>
30 #include <ndn-cxx/util/indented-stream.hpp>
36 const std::function<
void()>& onSuccess,
37 const ndn::nfd::DatasetFailureCallback& onFailure,
38 const CommandOptions& options)
40 controller.fetch<ndn::nfd::ForwarderGeneralStatusDataset>(
41 [
this, onSuccess] (
const ForwarderStatus& result) {
51 return status.getCurrentTimestamp() - status.getStartTimestamp();
63 os <<
"<generalStatus>";
65 os <<
"<version>" <<
xml::Text{item.getNfdVersion()} <<
"</version>";
71 os <<
"<nNameTreeEntries>" << item.getNNameTreeEntries() <<
"</nNameTreeEntries>";
72 os <<
"<nFibEntries>" << item.getNFibEntries() <<
"</nFibEntries>";
73 os <<
"<nPitEntries>" << item.getNPitEntries() <<
"</nPitEntries>";
74 os <<
"<nMeasurementsEntries>" << item.getNMeasurementsEntries() <<
"</nMeasurementsEntries>";
75 os <<
"<nCsEntries>" << item.getNCsEntries() <<
"</nCsEntries>";
77 os <<
"<packetCounters>";
78 os <<
"<incomingPackets>"
79 <<
"<nInterests>" << item.getNInInterests() <<
"</nInterests>"
80 <<
"<nData>" << item.getNInData() <<
"</nData>"
81 <<
"<nNacks>" << item.getNInNacks() <<
"</nNacks>"
82 <<
"</incomingPackets>";
83 os <<
"<outgoingPackets>"
84 <<
"<nInterests>" << item.getNOutInterests() <<
"</nInterests>"
85 <<
"<nData>" << item.getNOutData() <<
"</nData>"
86 <<
"<nNacks>" << item.getNOutNacks() <<
"</nNacks>"
87 <<
"</outgoingPackets>";
88 os <<
"</packetCounters>";
90 os <<
"<nSatisfiedInterests>" << item.getNSatisfiedInterests() <<
"</nSatisfiedInterests>";
91 os <<
"<nUnsatisfiedInterests>" << item.getNUnsatisfiedInterests() <<
"</nUnsatisfiedInterests>";
93 os <<
"</generalStatus>";
99 os <<
"General NFD status:\n";
100 ndn::util::IndentedStream indented(os,
" ");
109 os << ia(
"version") << item.getNfdVersion()
112 << ia(
"uptime") << text::formatDuration<time::seconds>(
calculateUptime(item),
true);
114 os << ia(
"nNameTreeEntries") << item.getNNameTreeEntries()
115 << ia(
"nFibEntries") << item.getNFibEntries()
116 << ia(
"nPitEntries") << item.getNPitEntries()
117 << ia(
"nMeasurementsEntries") << item.getNMeasurementsEntries()
118 << ia(
"nCsEntries") << item.getNCsEntries();
120 os << ia(
"nInInterests") << item.getNInInterests()
121 << ia(
"nOutInterests") << item.getNOutInterests()
122 << ia(
"nInData") << item.getNInData()
123 << ia(
"nOutData") << item.getNOutData()
124 << ia(
"nInNacks") << item.getNInNacks()
125 << ia(
"nOutNacks") << item.getNOutNacks()
126 << ia(
"nSatisfiedInterests") << item.getNSatisfiedInterests()
127 << ia(
"nUnsatisfiedInterests") << item.getNUnsatisfiedInterests();
Print attributes of an item.
std::string formatTimestamp(time::system_clock::time_point t)