• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

RakNetStatistics.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #ifndef __RAK_NET_STATISTICS_H
00011 #define __RAK_NET_STATISTICS_H
00012 
00013 #include "PacketPriority.h"
00014 #include "Export.h"
00015 #include "RakNetTypes.h"
00016 
00017 enum RNSPerSecondMetrics
00018 {
00019         USER_MESSAGE_BYTES_PUSHED,
00020         USER_MESSAGE_BYTES_SENT,
00021         USER_MESSAGE_BYTES_RESENT,
00022         USER_MESSAGE_BYTES_RECEIVED_PROCESSED,
00023         USER_MESSAGE_BYTES_RECEIVED_IGNORED,
00024         ACTUAL_BYTES_SENT,
00025         ACTUAL_BYTES_RECEIVED,
00026         RNS_PER_SECOND_METRICS_COUNT
00027 };
00028 
00032 struct RAK_DLL_EXPORT RakNetStatistics
00033 {
00034         uint64_t valueOverLastSecond[RNS_PER_SECOND_METRICS_COUNT];
00035         uint64_t runningTotal[RNS_PER_SECOND_METRICS_COUNT];
00036         
00037         RakNetTimeUS connectionStartTime;
00038 
00039         uint64_t BPSLimitByCongestionControl;
00040         bool isLimitedByCongestionControl;
00041 
00042         uint64_t BPSLimitByOutgoingBandwidthLimit;
00043         bool isLimitedByOutgoingBandwidthLimit;
00044 
00045         unsigned int messageInSendBuffer[NUMBER_OF_PRIORITIES];
00046         double bytesInSendBuffer[NUMBER_OF_PRIORITIES];
00047 
00048         unsigned int messagesInResendBuffer;
00049         uint64_t bytesInResendBuffer;
00050 
00051         float packetlossLastSecond, packetlossTotal;
00052 
00053         RakNetStatistics& operator +=(const RakNetStatistics& other)
00054         {
00055                 unsigned i;
00056                 for (i=0; i < NUMBER_OF_PRIORITIES; i++)
00057                 {
00058                         messageInSendBuffer[i]+=other.messageInSendBuffer[i];
00059                         bytesInSendBuffer[i]+=other.bytesInSendBuffer[i];
00060                 }
00061 
00062                 for (i=0; i < RNS_PER_SECOND_METRICS_COUNT; i++)
00063                 {
00064                         valueOverLastSecond[i]+=other.valueOverLastSecond[i];
00065                         runningTotal[i]+=other.runningTotal[i];
00066                 }
00067 
00068                 return *this;
00069         }
00070 };
00071 
00080 void RAK_DLL_EXPORT StatisticsToString( RakNetStatistics *s, char *buffer, int verbosityLevel );
00081 
00082 #endif

Generated on Thu Sep 30 2010 01:27:26 for RakNet by  doxygen 1.7.1