29 #include <ndn-cxx/util/indented-stream.hpp> 37 const std::function<
void()>& onSuccess,
38 const Controller::DatasetFailCallback& onFailure,
39 const CommandOptions& options)
41 controller.fetch<ndn::nfd::ForwarderGeneralStatusDataset>(
42 [
this, onSuccess] (
const ForwarderStatus& result) {
49 static time::system_clock::Duration
52 return status.getCurrentTimestamp() - status.getStartTimestamp();
64 os <<
"<generalStatus>";
66 os <<
"<version>" <<
xml::Text{item.getNfdVersion()} <<
"</version>";
72 os <<
"<nNameTreeEntries>" << item.getNNameTreeEntries() <<
"</nNameTreeEntries>";
73 os <<
"<nFibEntries>" << item.getNFibEntries() <<
"</nFibEntries>";
74 os <<
"<nPitEntries>" << item.getNPitEntries() <<
"</nPitEntries>";
75 os <<
"<nMeasurementsEntries>" << item.getNMeasurementsEntries() <<
"</nMeasurementsEntries>";
76 os <<
"<nCsEntries>" << item.getNCsEntries() <<
"</nCsEntries>";
78 os <<
"<packetCounters>";
79 os <<
"<incomingPackets>" 80 <<
"<nInterests>" << item.getNInInterests() <<
"</nInterests>" 81 <<
"<nData>" << item.getNInData() <<
"</nData>" 82 <<
"<nNacks>" << item.getNInNacks() <<
"</nNacks>" 83 <<
"</incomingPackets>";
84 os <<
"<outgoingPackets>" 85 <<
"<nInterests>" << item.getNOutInterests() <<
"</nInterests>" 86 <<
"<nData>" << item.getNOutData() <<
"</nData>" 87 <<
"<nNacks>" << item.getNOutNacks() <<
"</nNacks>" 88 <<
"</outgoingPackets>";
89 os <<
"</packetCounters>";
91 os <<
"<nSatisfiedInterests>" << item.getNSatisfiedInterests() <<
"</nSatisfiedInterests>";
92 os <<
"<nUnsatisfiedInterests>" << item.getNUnsatisfiedInterests() <<
"</nUnsatisfiedInterests>";
94 os <<
"</generalStatus>";
100 os <<
"General NFD status:\n";
101 ndn::util::IndentedStream indented(os,
" ");
110 os << ia(
"version") << item.getNfdVersion()
113 << ia(
"uptime") << text::formatDuration<time::seconds>(
calculateUptime(item),
true);
115 os << ia(
"nNameTreeEntries") << item.getNNameTreeEntries()
116 << ia(
"nFibEntries") << item.getNFibEntries()
117 << ia(
"nPitEntries") << item.getNPitEntries()
118 << ia(
"nMeasurementsEntries") << item.getNMeasurementsEntries()
119 << ia(
"nCsEntries") << item.getNCsEntries();
121 os << ia(
"nInInterests") << item.getNInInterests()
122 << ia(
"nOutInterests") << item.getNOutInterests()
123 << ia(
"nInData") << item.getNInData()
124 << ia(
"nOutData") << item.getNOutData()
125 << ia(
"nInNacks") << item.getNInNacks()
126 << ia(
"nOutNacks") << item.getNOutNacks()
127 << ia(
"nSatisfiedInterests") << item.getNSatisfiedInterests()
128 << ia(
"nUnsatisfiedInterests") << item.getNUnsatisfiedInterests();
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
std::string formatTimestamp(time::system_clock::TimePoint t)
print attributes of an item