26 #ifndef NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP 27 #define NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP 32 #include <ndn-cxx/util/rtt-estimator.hpp> 44 FaceInfo(shared_ptr<const ndn::util::RttEstimator::Options> opts)
45 : m_rttEstimator(
std::move(opts))
52 return !!m_timeoutEvent;
65 m_rttEstimator.addMeasurement(rtt);
90 return m_rttEstimator.getSmoothedRtt();
96 return m_nSilentTimeouts;
102 m_nSilentTimeouts = nSilentTimeouts;
110 ndn::util::RttEstimator m_rttEstimator;
112 Name m_lastInterestName;
113 size_t m_nSilentTimeouts = 0;
116 scheduler::ScopedEventId m_measurementExpiration;
120 scheduler::ScopedEventId m_timeoutEvent;
139 : m_rttEstimatorOpts(
std::move(opts))
144 getFaceInfo(
FaceId faceId);
147 getOrCreateFaceInfo(
FaceId faceId);
155 return m_isProbingDue;
161 m_isProbingDue = isProbingDue;
167 return m_isFirstProbeScheduled;
173 m_isFirstProbeScheduled = isScheduled;
177 std::unordered_map<FaceId, FaceInfo> m_fiMap;
178 shared_ptr<const ndn::util::RttEstimator::Options> m_rttEstimatorOpts;
179 bool m_isProbingDue =
false;
180 bool m_isFirstProbeScheduled =
false;
195 getFaceInfo(
const fib::Entry& fibEntry,
const Interest& interest,
FaceId faceId);
198 getOrCreateFaceInfo(
const fib::Entry& fibEntry,
const Interest& interest,
FaceId faceId);
201 getNamespaceInfo(
const Name& prefix);
204 getOrCreateNamespaceInfo(
const fib::Entry& fibEntry,
const Interest& interest);
211 static constexpr time::microseconds MEASUREMENTS_LIFETIME = 5_min;
215 shared_ptr<const ndn::util::RttEstimator::Options> m_rttEstimatorOpts;
222 #endif // NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP void cancelTimeout(const Name &prefix)
static const time::nanoseconds RTT_NO_MEASUREMENT
static const time::nanoseconds RTT_TIMEOUT
size_t getNSilentTimeouts() const
Represents a Measurements entry.
bool isProbingDue() const
void setIsProbingDue(bool isProbingDue)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
time::nanoseconds getLastRtt() const
contains arbitrary information forwarding strategy places on table entries
void setIsFirstProbeScheduled(bool isScheduled)
time::nanoseconds scheduleTimeout(const Name &interestName, scheduler::EventCallback cb)
allows Strategy to access portion of Measurements table under its namespace
bool isFirstProbeScheduled() const
Stores strategy information about each face in this namespace.
void recordTimeout(const Name &interestName)
NamespaceInfo(shared_ptr< const ndn::util::RttEstimator::Options > opts)
FaceInfo(shared_ptr< const ndn::util::RttEstimator::Options > opts)
static constexpr int getTypeId()
void recordRtt(time::nanoseconds rtt)
uint64_t FaceId
Identifies a face.
void setNSilentTimeouts(size_t nSilentTimeouts)
bool isTimeoutScheduled() const
Strategy information for each face in a namespace.
Helper class to retrieve and create strategy measurements.
time::nanoseconds getSrtt() const