#include <GlobalStatistics.h>
Public Attributes | |
double | sentKBRTestAppMessages |
total number of messages sent by KBRTestApp | |
double | deliveredKBRTestAppMessages |
total number of messages delivered by KBRTestApp | |
double | sentTotalBytes |
total number of sent bytes | |
int | testCount |
cOutVector | globalDelayVector |
statistical output vector for packet-delays | |
cOutVector | currentDeliveryVector |
statistical output vector for current delivery ratio | |
Protected Member Functions | |
virtual void | initialize () |
Init member function of module. | |
virtual void | handleMessage (cMessage *msg) |
HandleMessage member function of module. | |
virtual void | finish () |
Finish member function of module. |
void GlobalStatistics::finish | ( | ) | [protected, virtual] |
Finish member function of module.
00076 { 00077 recordScalar("GlobalStatistics: Total Sent Bytes", sentTotalBytes); 00078 00079 // recordScalar("GlobalStatistics: Test Count", testCount); 00080 00081 }
void GlobalStatistics::handleMessage | ( | cMessage * | msg | ) | [protected, virtual] |
HandleMessage member function of module.
00050 { 00051 if (msg->isName("globalStatTimer")) { 00052 // schedule next timer event 00053 scheduleAt(simulation.simTime() + 120, msg); 00054 00055 double ratio; 00056 00057 if (sentKBRTestAppMessages == 0) { 00058 ratio = 0; 00059 } else { 00060 ratio = (double)deliveredKBRTestAppMessages / 00061 (double)sentKBRTestAppMessages; 00062 } 00063 if (ratio > 1) ratio = 1; 00064 00065 currentDeliveryVector.record(ratio); 00066 sentKBRTestAppMessages = 0; 00067 deliveredKBRTestAppMessages = 0; 00068 00069 return; 00070 } 00071 00072 error("GlobalStatistics::handleMessage(): Unknown message type!"); 00073 }
void GlobalStatistics::initialize | ( | ) | [protected, virtual] |
Init member function of module.
00031 { 00032 sentKBRTestAppMessages = 0; 00033 deliveredKBRTestAppMessages = 0; 00034 sentTotalBytes = 0; 00035 testCount = 0; 00036 00037 globalDelayVector.setName("Global Delay Time"); 00038 currentDeliveryVector.setName("Current Delivery Ratio"); 00039 00040 // start periodic globalStatTimer 00041 cMessage* globalStatTimer = new cMessage("globalStatTimer"); 00042 scheduleAt(simulation.simTime() + 120, globalStatTimer); 00043 00044 WATCH(sentTotalBytes); 00045 WATCH(globalDelayVector); 00046 WATCH(currentDeliveryVector); 00047 }
cOutVector GlobalStatistics::currentDeliveryVector |
statistical output vector for current delivery ratio
total number of messages delivered by KBRTestApp
cOutVector GlobalStatistics::globalDelayVector |
statistical output vector for packet-delays
total number of messages sent by KBRTestApp
total number of sent bytes