26 #ifndef NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP 27 #define NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP 40 typedef time::duration<double, boost::micro>
Rtt;
73 computeSrtt(Rtt previousSrtt, Rtt currentRtt);
84 static const double ALPHA;
95 class Error :
public std::runtime_error
100 :
std::runtime_error(what)
110 setTimeoutEvent(
const scheduler::EventId&
id,
const Name& interestName);
115 m_measurementExpirationId = id;
118 const scheduler::EventId&
121 return m_measurementExpirationId;
125 cancelTimeoutEvent(
const Name& prefix);
130 return m_isTimeoutScheduled;
134 recordRtt(
const shared_ptr<pit::Entry>& pitEntry,
const Face& inFace);
148 return m_rttStats.computeRto();
154 return m_rttStats.getRtt();
160 return m_rttStats.getSrtt();
171 cancelTimeoutEvent();
174 doesNameMatchLastInterest(
const Name& name);
178 Name m_lastInterestName;
181 scheduler::EventId m_measurementExpirationId;
184 scheduler::EventId m_timeoutEventId;
185 bool m_isTimeoutScheduled;
207 getOrCreateFaceInfo(
const fib::Entry& fibEntry,
const Face& face);
210 getFaceInfo(
const fib::Entry& fibEntry,
const Face& face);
216 extendFaceInfoLifetime(
FaceInfo& info,
const Face& face);
221 if (m_fit.find(faceId) != m_fit.end()) {
222 return &m_fit.at(faceId);
232 return m_fit.find(faceId);
244 const auto& pair = m_fit.insert(std::make_pair(faceId,
FaceInfo()));
251 return m_isProbingDue;
257 m_isProbingDue = isProbingDue;
263 return m_hasFirstProbeBeenScheduled;
269 m_hasFirstProbeBeenScheduled = hasBeenScheduled;
276 bool m_hasFirstProbeBeenScheduled;
291 getFaceInfo(
const fib::Entry& fibEntry,
const Interest& interest,
const Face& face);
294 getOrCreateFaceInfo(
const fib::Entry& fibEntry,
const Interest& interest,
const Face& face);
297 getNamespaceInfo(
const Name& prefix);
300 getOrCreateNamespaceInfo(
const fib::Entry& fibEntry,
const Interest& interest);
307 static constexpr time::microseconds MEASUREMENTS_LIFETIME = time::seconds(300);
310 MeasurementsAccessor& m_measurements;
317 #endif // NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP const FaceInfoTable::iterator insert(nfd::face::FaceId faceId)
RttStats::Rtt getRtt() const
represents a Measurements entry
bool hasSrttMeasurement() const
time::microseconds Duration
void addRttMeasurement(RttEstimator::Duration &durationRtt)
implements the Mean-Deviation RTT estimator
RttStats::Rtt getSrtt() const
time::duration< double, boost::micro > Rtt
FaceInfoTable::iterator end()
void setIsProbingDue(bool isProbingDue)
Table::const_iterator iterator
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
contains arbitrary information forwarding strategy places on table entries
void setHasFirstProbeBeenScheduled(bool hasBeenScheduled)
Error(const std::string &what)
const scheduler::EventId & getMeasurementExpirationEventId()
bool isTimeoutScheduled() const
stores stategy information about each face in this namespace
static const Rtt RTT_TIMEOUT
bool isFirstProbeScheduled() const
static constexpr int getTypeId()
uint64_t FaceId
identifies a face
RttEstimator::Duration computeRto() const
RttEstimator::Duration computeRto() const
Duration computeRto() const
void setMeasurementExpirationEventId(const scheduler::EventId &id)
FaceInfoTable::iterator find(nfd::face::FaceId faceId)
Strategy information for each face in a namespace.
Helper class to retrieve and create strategy measurements.
std::unordered_map< face::FaceId, FaceInfo > FaceInfoTable
static const Rtt RTT_NO_MEASUREMENT
bool isProbingDue() const