SLikeNet  0.1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
statistics.h
Go to the documentation of this file.
1 /*
2  * Original work: Copyright (c) 2014, Oculus VR, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7  * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8  *
9  *
10  * Modified work: Copyright (c) 2016-2018, SLikeSoft UG (haftungsbeschränkt)
11  *
12  * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13  * license found in the license.txt file in the root directory of this source tree.
14  */
15 
19 
20 
21 
22 #ifndef __RAK_NET_STATISTICS_H
23 #define __RAK_NET_STATISTICS_H
24 
25 #include "PacketPriority.h"
26 #include "Export.h"
27 #include "types.h"
28 
29 namespace SLNet
30 {
31 
33 {
36 
40 
43 
46 
49 
52 
55 
58 };
59 
64 {
66  uint64_t valueOverLastSecond[RNS_PER_SECOND_METRICS_COUNT];
67 
70 
74 
78 
81 
84 
87 
89  unsigned int messageInSendBuffer[NUMBER_OF_PRIORITIES];
90 
92  double bytesInSendBuffer[NUMBER_OF_PRIORITIES];
93 
96  unsigned int messagesInResendBuffer;
97 
100 
103 
106 
107  RakNetStatistics& operator +=(const RakNetStatistics& other)
108  {
109  unsigned i;
110  for (i=0; i < NUMBER_OF_PRIORITIES; i++)
111  {
112  messageInSendBuffer[i]+=other.messageInSendBuffer[i];
113  bytesInSendBuffer[i]+=other.bytesInSendBuffer[i];
114  }
115 
116  for (i=0; i < RNS_PER_SECOND_METRICS_COUNT; i++)
117  {
118  valueOverLastSecond[i]+=other.valueOverLastSecond[i];
119  runningTotal[i]+=other.runningTotal[i];
120  }
121 
122  return *this;
123  }
124 };
125 
135 void RAK_DLL_EXPORT StatisticsToString(RakNetStatistics *s, char *buffer, int verbosityLevel);
136 void RAK_DLL_EXPORT StatisticsToString( RakNetStatistics *s, char *buffer, size_t bufferLength, int verbosityLevel );
137 
138 } // namespace SLNet
139 
140 #endif