28 #include "core/version.hpp" 35 : m_forwarder(forwarder)
36 , m_dispatcher(dispatcher)
37 , m_startTimestamp(
time::system_clock::now())
40 bind(&ForwarderStatusManager::listGeneralStatus,
this, _1, _2, _3));
44 ForwarderStatusManager::collectGeneralStatus()
70 ForwarderStatusManager::listGeneralStatus(
const Name& topPrefix,
const Interest& interest,
75 auto status = this->collectGeneralStatus();
78 for (
const auto& subblock : wire.elements()) {
const ForwarderCounters & getCounters() const
represents NFD General Status dataset
StatusDatasetContext & setExpiry(const time::milliseconds &expiry)
set expiration duration
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend ForwarderStatus as a Content block to the encoder
ForwarderStatus & setNFibEntries(size_t nFibEntries)
static const time::milliseconds STATUS_FRESHNESS(5000)
counters provided by Forwarder
ForwarderStatus & setNOutNacks(uint64_t nOutNacks)
represents a dispatcher on server side of NFD Management protocol
ForwarderStatus & setNInData(uint64_t nInData)
ForwarderStatus & setNOutData(uint64_t nOutData)
ForwarderStatus & setNInNacks(uint64_t nInNacks)
PacketCounter nInInterests
ForwarderStatus & setNCsEntries(size_t nCsEntries)
static time_point now() noexcept
Authorization makeAcceptAllAuthorization()
ForwarderStatus & setNNameTreeEntries(size_t nNameTreeEntries)
size_t size() const
get number of stored packets
ForwarderStatus & setNInInterests(uint64_t nInInterests)
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Copyright (c) 2011-2015 Regents of the University of California.
void end()
end the response successfully after appending zero or more blocks
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
ForwarderStatus & setNPitEntries(size_t nPitEntries)
PacketCounter nOutInterests
void addStatusDataset(const PartialName &relPrefix, const Authorization &authorization, const StatusDatasetHandler &handler)
register a StatusDataset or a prefix under which StatusDatasets can be requested
Measurements & getMeasurements()
void append(const Block &block)
append a Block to the response
provides a context for generating response to a StatusDataset request
ForwarderStatus & setNMeasurementsEntries(size_t nMeasurementsEntries)
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
ForwarderStatusManager(Forwarder &forwarder, Dispatcher &dispatcher)