forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::StatsModule Class Reference
Collaboration diagram for forest::StatsModule:

Classes

struct  LinkCounts
 
struct  QueueCounts
 
struct  StatItem
 

Public Member Functions

 StatsModule (int, int, int, ComtreeTable *)
 
int iPktCnt (int)
 
int oPktCnt (int)
 
int discCnt (int)
 
int qDiscCnt (int)
 
int iByteCnt (int)
 
int oByteCnt (int)
 
int getQlen (int)
 
int getQbytes (int)
 
int getLinkQlen (int)
 
void clearLnkStats (int)
 
void clearQuStats (int)
 
void cntInLink (int, int, bool)
 
void cntOutLink (int, int, bool)
 
void cntDiscards (int, int, bool)
 
void incQlen (int, int, int)
 
void decQlen (int, int, int)
 
void record (uint64_t)
 
bool read (istream &)
 
string toString ()
 Create a string representing the stats module. More...
 

Private Types

enum  cntrTyp {
  inPkt, outPkt, inByt, outByt,
  qPkt, qByt, disc
}
 

Private Member Functions

bool readStat (istream &)
 Read an entry from in and store it in the stats table. More...
 
string stat2string (int) const
 Create a string representing an entry in the table. More...
 

Private Attributes

int maxStats
 
int maxLnk
 
int maxQ
 
int n
 
mutex mtx
 
StatItemstat
 
ofstream fs
 
LinkCountslnkCnts
 
QueueCountsqCnts
 
int totInByte
 
int totInPkt
 
int totDiscards
 
int rtrInByte
 
int rtrInPkt
 
int leafInByte
 
int leafInPkt
 
int totOutByte
 
int totOutPkt
 
int rtrOutByte
 
int rtrOutPkt
 
int rtrDiscards
 
int leafOutByte
 
int leafOutPkt
 
int leafDiscards
 
ComtreeTablectt
 

Detailed Description

Definition at line 17 of file StatsModule.h.

Member Function Documentation

bool forest::StatsModule::readStat ( istream &  in)
private

Read an entry from in and store it in the stats table.

Return true on success false on failure. A line is a pure comment line if it starts with a # sign. A trailing comment is also allowed at the end of a line by including a # sign. All lines that are not pure comment lines or blank are assumed to contain a complete statistics request. Each entry consists of a type string and one or more additional arguments that depend on the type. The full list is given below.

inPkt L number of packets received on input link L outPkt L number of packets sent on output link L inByt L number of bytes received on input link L outByt L number of bytes sent on output link L qPkt L C number of packets for comtree C output link L qByt L C number of bytes for comtree C on output link L disc L C number of packets discarded for comtree C on link L

If inPkt, outPkt, inByt, outByt are given with a link # of 0, the statistics for the router as a whole are reported. If the link # is -1, the statistics for packets to/from other routers is reported. If the link # is -2, the statistics for packets to/from leaf nodes is reported. In the queue packet length statistics, if the given comtree number is zero, then the total number of packets (bytes) queued for the given link (over all queues) is reported. Similarly, for the discard statistic, a comtree of 0 reports all discards for the link.

Definition at line 144 of file StatsModule.cpp.

string & forest::StatsModule::stat2string ( int  i) const
private

Create a string representing an entry in the table.

Parameters
iis the index of an entry
Returns
the string
Parameters
iis the index of an entry
sis a reference to a string in which result is returned
Returns
a reference to s

Definition at line 206 of file StatsModule.cpp.

Here is the caller graph for this function:

string & forest::StatsModule::toString ( )

Create a string representing the stats module.

Parameters
sis a reference to a string in which the result is returned
Returns
a reference to s

Definition at line 243 of file StatsModule.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: