#include <Stats.h>
Not thread-safe, requires external locking mechanism.
Definition at line 44 of file Stats.h.
Public Member Functions | |
Stats () | |
Default constructor. | |
~Stats () | |
Destructor. | |
void | update_stats (const Bundle *b, double p) |
Given a Bundle and a predictability value, update the stats kept for that Bundle. | |
double | get_p_max (const Bundle *b) const |
Given a Bundle, return the max predictability for any route over which this Bundle has been forwarded. | |
double | get_mopr (const Bundle *b) const |
Given a Bundle, return the predictability favor for the routes over which this Bundle has been forwarded, according to Eq. | |
double | get_lmopr (const Bundle *b) const |
Given a Bundle, return the linear predictability favor for the routes over which this Bundle has been forwarded, according to Eq. | |
void | drop_bundle (const Bundle *b) |
Bundle is no longer with us, so get rid of its stats. | |
u_int | dropped () const |
Return count of how many Bundle stats have been dropped so far. | |
size_t | size () const |
Return count of Bundles currently rep'd in Stats. | |
Protected Types | |
typedef std::map< u_int32_t, StatsEntry * > | pstats |
typedef std::map< u_int32_t, StatsEntry * >::iterator | iterator |
typedef std::map< u_int32_t, StatsEntry * >::const_iterator | const_iterator |
Protected Member Functions | |
StatsEntry * | find (const Bundle *b) |
Convenience function for finding the StatEntry per bundle id. | |
Protected Attributes | |
u_int | dropped_ |
pstats | pstats_ |
typedef std::map<u_int32_t,StatsEntry*> prophet::Stats::pstats [protected] |
typedef std::map<u_int32_t,StatsEntry*>::iterator prophet::Stats::iterator [protected] |
typedef std::map<u_int32_t,StatsEntry*>::const_iterator prophet::Stats::const_iterator [protected] |
void prophet::Stats::update_stats | ( | const Bundle * | b, | |
double | p | |||
) |
Given a Bundle and a predictability value, update the stats kept for that Bundle.
Definition at line 32 of file Stats.cc.
References find(), prophet::StatsEntry::lmopr_, prophet::StatsEntry::mopr_, and prophet::StatsEntry::p_max_.
double prophet::Stats::get_p_max | ( | const Bundle * | b | ) | const |
double prophet::Stats::get_mopr | ( | const Bundle * | b | ) | const |
Given a Bundle, return the predictability favor for the routes over which this Bundle has been forwarded, according to Eq.
7, Section 3.7
Definition at line 60 of file Stats.cc.
References find(), and prophet::StatsEntry::mopr_.
Referenced by prophet::QueueCompMOPR::operator()().
double prophet::Stats::get_lmopr | ( | const Bundle * | b | ) | const |
Given a Bundle, return the linear predictability favor for the routes over which this Bundle has been forwarded, according to Eq.
8, Section 3.7
Definition at line 67 of file Stats.cc.
References find(), and prophet::StatsEntry::lmopr_.
Referenced by prophet::QueueCompLMOPR::operator()().
void prophet::Stats::drop_bundle | ( | const Bundle * | b | ) |
u_int prophet::Stats::dropped | ( | ) | const [inline] |
size_t prophet::Stats::size | ( | ) | const [inline] |
StatsEntry * prophet::Stats::find | ( | const Bundle * | b | ) | [protected] |
Convenience function for finding the StatEntry per bundle id.
Definition at line 74 of file Stats.cc.
References pstats_, and prophet::Bundle::sequence_num().
Referenced by get_lmopr(), get_mopr(), get_p_max(), and update_stats().
u_int prophet::Stats::dropped_ [protected] |
pstats prophet::Stats::pstats_ [mutable, protected] |