HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_WebStatsManager.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: NET_WebStatsManager.h
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __NET_WEBSTATSMANAGER_H__
13 #define __NET_WEBSTATSMANAGER_H__
14 
15 #include "NET_API.h"
16 
17 #include <UT/UT_Lock.h>
18 
19 /// Simple holder for statistics relating to the web server.
20 class NET_API NET_WebStatsManager
21 {
22 public:
23  void updateProcess(fpreal amount);
24  void updateQueueWait(fpreal amount);
25 
26  void setEnabled(bool enabled) { myIsEnabled = enabled; }
27  inline bool isEnabled() const { return myIsEnabled; }
28 
29  void addTotalRequests(unsigned amount);
30  void addCurrentQueueSize(int amount);
31  void addFailCount(unsigned count);
32 
33  fpreal maxProcessTime() const;
34  fpreal maxQueueWaitTime() const;
35 
36  fpreal averageProcessTime() const;
37  fpreal averageQueueWaitTime() const;
38 
39  unsigned currentQueueSize() const;
40  unsigned maxQueueSize() const;
41 private:
42  enum WaitType
43  {
44  PROCESS_WAIT = 0,
45  QUEUE_WAIT = 1,
46  MAX_WAIT_TYPE
47  };
48  mutable UT_Lock myLock;
49  fpreal myMaxWaits[WaitType::MAX_WAIT_TYPE];
50  fpreal myTotalWaits[WaitType::MAX_WAIT_TYPE];
51 
52  bool myIsEnabled = false;
53 
54  unsigned myTotalRequests;
55  unsigned myCurrentQueueSize;
56  unsigned myMaxQueueSize;
57  unsigned myFailCount;
58 };
59 
60 #endif // __NET_WEBSTATSMANAGER_H__
61 
void setEnabled(bool enabled)
Simple holder for statistics relating to the web server.
GLenum GLsizei const GLuint GLboolean enabled
Definition: glew.h:2579
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint GLuint GLsizei count
Definition: glew.h:1253