Statistics Class Reference
[pydtn]

DTN::Consumer for collecting statistical information on a simulated DTN. More...

#include <pydtn/Statistics.h>

Inheritance diagram for Statistics:

Inheritance graph
[legend]
Collaboration diagram for Statistics:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Statistics (DTN::Node *owner)
 Default constructor.
virtual ~Statistics ()
 Virtual destructor.
virtual void operator() (const DTN::Bundle &b)
 Functional method.
virtual void drop (const DTN::Bundle &b, const DTN::DropCause &c)
 Recording method for dropped DTN::Bundles.
virtual void custody (const DTN::Bundle &b)
 Recording method for accepting custody of a DTN::Bundle.
virtual void persistentStore (const DTN::Bundle &b)
 Recording method for adding a DTN::Bundle to the persistent store.
virtual void persistentRemove (const DTN::Bundle &b, bool cleanup=true)
 Recording method for removing a DTN::Bundle from the persistent store.
virtual void send (const DTN::Bundle &b)
 Recording method for sending a DTN::Bundle.
virtual void recv (const DTN::Bundle &b)
 Recording method for receiving a DTN::Bundle.
virtual void exhausted (const DTN::Bundle &b)
 Recording method for persistent storage exhaustion.
const StatCollectionsince () const
 
Returns:
statistics accumulated since the last reset()

const StatCollectiontotal () const
 
Returns:
statistics accumulated from the start of simulation

void reset ()
 Reset short-term accumulators.
void resetTotals ()
 Reset long-term accumulators.
virtual unsigned long int used () const
 
Returns:
the number of bytes of stable storage used at this instant

virtual unsigned long int capacity () const
 
Returns:
the capacity (in bytes) of stable storage at this instant


Protected Member Functions

void testOrigin (const DTN::Bundle &b)
 Test a bundle to see if this looks like the origin.

Protected Attributes

StatCollection m_total
 Collection of statistics from the start of the simulation.
StatCollection m_since
 Collection of statistics since the last reset().


Detailed Description

DTN::Consumer for collecting statistical information on a simulated DTN.

Definition at line 160 of file Statistics.h.


Member Function Documentation

void Statistics::operator() ( const DTN::Bundle b  )  [virtual]

Functional method.

Parameters:
b A bundle to process

Implements DTN::Consumer.

Definition at line 155 of file Statistics.cc.

References StatCollection::addDelivered(), DTN::Bundle::kACK, DTN::Bundle::kData, m_since, m_total, and DTN::Bundle::type().

void Statistics::drop ( const DTN::Bundle b,
const DTN::DropCause c 
) [virtual]

Recording method for dropped DTN::Bundles.

Parameters:
b A bundle being dropped
c The reason for dropping the bundle

Todo:
Categorize dropped bundles further.

Reimplemented from DTN::Consumer.

Definition at line 170 of file Statistics.cc.

References StatCollection::addDropped(), m_since, and m_total.

void Statistics::custody ( const DTN::Bundle b  )  [virtual]

Recording method for accepting custody of a DTN::Bundle.

Parameters:
b A bundle being custodially accepted

Reimplemented from DTN::Consumer.

Definition at line 178 of file Statistics.cc.

void Statistics::persistentStore ( const DTN::Bundle b  )  [virtual]

Recording method for adding a DTN::Bundle to the persistent store.

Parameters:
b A bundle being stored

Reimplemented from DTN::Consumer.

Reimplemented in MultiNodeStatistics.

Definition at line 183 of file Statistics.cc.

References DTN::Consumer::m_owner, m_since, m_total, StatCollection::setExhausted(), and used().

void Statistics::persistentRemove ( const DTN::Bundle b,
bool  cleanup = true 
) [virtual]

Recording method for removing a DTN::Bundle from the persistent store.

Parameters:
b A bundle being removed
cleanup Whether the persistent store's clean-up method should be invoked (can cause recursion loops)

Reimplemented from DTN::Consumer.

Definition at line 213 of file Statistics.cc.

void Statistics::send ( const DTN::Bundle b  )  [virtual]

Recording method for sending a DTN::Bundle.

Parameters:
b A bundle being sent

Reimplemented from DTN::Consumer.

Definition at line 218 of file Statistics.cc.

References StatCollection::addSent(), m_since, m_total, DTN::Bundle::size(), and testOrigin().

void Statistics::recv ( const DTN::Bundle b  )  [virtual]

Recording method for receiving a DTN::Bundle.

Parameters:
b A bundle being received

Reimplemented from DTN::Consumer.

Definition at line 228 of file Statistics.cc.

References StatCollection::addReceived(), m_since, m_total, and DTN::Bundle::size().

void Statistics::exhausted ( const DTN::Bundle b  )  [virtual]

Recording method for persistent storage exhaustion.

Parameters:
b A bundle that could not be stored

Reimplemented from DTN::Consumer.

Definition at line 236 of file Statistics.cc.

References m_since, m_total, and StatCollection::setExhausted().

void Statistics::reset (  )  [inline]

Reset short-term accumulators.

This is useful for looking at statistics in discrete time bins.

Definition at line 212 of file Statistics.h.

References m_since, and StatCollection::reset().

Referenced by GStatDump::dump().

void Statistics::resetTotals (  )  [inline]

Reset long-term accumulators.

This should only be done if you really want to erase the entire accumulated history.

Definition at line 216 of file Statistics.h.

References m_since, m_total, and StatCollection::reset().

Referenced by GStatEntity::handler().

void Statistics::testOrigin ( const DTN::Bundle b  )  [protected]

Test a bundle to see if this looks like the origin.

If so, add to the originated count. This should be called from persistentStore() in any subclass

Parameters:
b A bundle being tested

Definition at line 197 of file Statistics.cc.

References StatCollection::addOriginated(), DTN::Bundle::kACK, m_since, m_total, DTN::Bundle::send(), DTN::Bundle::source(), and DTN::Bundle::type().

Referenced by send().


The documentation for this class was generated from the following files:
Generated on Mon Mar 24 11:15:47 2008 for Pydtn Simulator by  doxygen 1.5.4