35 : m_forwarder(forwarder)
36 , m_dispatcher(dispatcher)
37 , m_startTimestamp(time::system_clock::now())
39 m_dispatcher.addStatusDataset(
"status/general", ndn::mgmt::makeAcceptAllAuthorization(),
40 bind(&ForwarderStatusManager::listGeneralStatus,
this, _1, _2, _3));
43 ndn::nfd::ForwarderStatus
44 ForwarderStatusManager::collectGeneralStatus()
46 ndn::nfd::ForwarderStatus status;
49 status.setStartTimestamp(m_startTimestamp);
50 status.setCurrentTimestamp(time::system_clock::now());
53 status.setNFibEntries(m_forwarder.
getFib().
size());
54 status.setNPitEntries(m_forwarder.
getPit().
size());
56 status.setNCsEntries(m_forwarder.
getCs().
size());
72 ForwarderStatusManager::listGeneralStatus(
const Name& topPrefix,
const Interest& interest,
73 ndn::mgmt::StatusDatasetContext& context)
77 auto status = this->collectGeneralStatus();
78 const Block& wire = status.wireEncode();
80 for (
const auto& subblock : wire.elements()) {
81 context.append(subblock);
Main class of NFD's forwarding engine.
static const time::milliseconds STATUS_FRESHNESS(5000)
PacketCounter nInInterests
PacketCounter nUnsatisfiedInterests
const ForwarderCounters & getCounters() const
PacketCounter nOutInterests
ForwarderStatusManager(Forwarder &forwarder, Dispatcher &dispatcher)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
const char NFD_VERSION_BUILD_STRING[]
NFD version string, including git commit information, if NFD is build from specific git commit...
size_t size() const
get number of stored packets
Counters provided by Forwarder.
Measurements & getMeasurements()
PacketCounter nSatisfiedInterests