Container for Bundle statistics, indexed by Bundle identifier. More...
#include <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_ |
Container for Bundle statistics, indexed by Bundle identifier.
Not thread-safe, requires external locking mechanism.
Definition at line 44 of file Stats.h.
typedef std::map<u_int32_t,StatsEntry*>::const_iterator prophet::Stats::const_iterator [protected] |
typedef std::map<u_int32_t,StatsEntry*>::iterator prophet::Stats::iterator [protected] |
typedef std::map<u_int32_t,StatsEntry*> prophet::Stats::pstats [protected] |
void prophet::Stats::drop_bundle | ( | const Bundle * | b | ) |
Bundle is no longer with us, so get rid of its stats.
Definition at line 96 of file Stats.cc.
References dropped_, pstats_, and prophet::Bundle::sequence_num().
Referenced by prophet::Oracle::ack().
u_int prophet::Stats::dropped | ( | ) | 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().
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()().
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_p_max | ( | const Bundle * | b | ) | const |
Given a Bundle, return the max predictability for any route over which this Bundle has been forwarded.
Definition at line 53 of file Stats.cc.
References find(), and prophet::StatsEntry::p_max_.
Referenced by prophet::FwdDeciderGTMXPLUS::operator()(), and prophet::FwdDeciderGRTRPLUS::operator()().
size_t prophet::Stats::size | ( | ) | const [inline] |
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_.
Referenced by prophet::Controller::handle_bundle_transmitted().
u_int prophet::Stats::dropped_ [protected] |
Definition at line 111 of file Stats.h.
Referenced by drop_bundle(), and dropped().
pstats prophet::Stats::pstats_ [mutable, protected] |