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_BoostAsio.h>
18 #include <UT/UT_Optional.h>
19 
20 #include <SYS/SYS_AtomicInt.h>
21 
22 /// Simple holder for statistics relating to the web server.
24 {
25 public:
27  {
28  }
29 
30  void updateProcess(fpreal amount);
31  void updateQueueWait(fpreal amount);
32 
33  void setEnabled(bool enabled) { myIsEnabled = enabled; }
34  inline bool isEnabled() const { return myIsEnabled; }
35 
42 
43  void startLogTimer(ASIO_IOContext& context);
44  void stopLogTimer();
45 private:
46  void fail(const hboost::system::error_code& ec, const char* what);
47 
48  void startLogTimer_();
49  void onLogStats_(const hboost::system::error_code& ec);
50 
51  enum WaitType
52  {
53  PROCESS_WAIT = 0,
54  QUEUE_WAIT = 1,
55  MAX_WAIT_TYPE
56  };
57 
59 
60  bool myIsEnabled = false;
61 };
62 
63 #endif // __NET_WEBSTATSMANAGER_H__
64 
SYS_AtomicInt32 myWaitingCount
SYS_AtomicInt32 myWriteCount
void setEnabled(bool enabled)
SYS_AtomicInt32 myRequestCount
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
std::optional< T > UT_Optional
Definition: UT_Optional.h:26
#define NET_API
Definition: NET_API.h:9
Simple holder for statistics relating to the web server.
hboost::asio::io_context ASIO_IOContext
Definition: UT_BoostAsio.h:74
SYS_AtomicInt32 myTotalCount
fpreal64 fpreal
Definition: SYS_Types.h:277
SYS_AtomicInt32 myReadCount
SYS_AtomicInt32 myActiveConnections