iFun Engine API  1.0.0-b2936
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
counter.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_MANAGEMENT_COUNTER_H_
10 #define INCLUDE_FUNAPI_MANAGEMENT_COUNTER_H_
11 
12 #include <boost/asio/ip/address.hpp>
13 #include <funapi/common/json.h>
15 #include <funapi/types.h>
16 
17 
18 namespace fun {
19 
20 typedef boost::function<
21  http::StatusCode(const string &, const string &, Json *)> CounterCallback;
22 
23 
24 void UpdateCounter(const string &counter_type,
25  const string &counter_id,
26  const int32_t &value);
27 
28 
29 void UpdateCounter(const string &counter_type,
30  const string &counter_id,
31  const int64_t &value);
32 
33 
34 void UpdateCounter(const string &counter_type,
35  const string &counter_id,
36  const double &value);
37 
38 
39 void UpdateCounter(const string &counter_type,
40  const string &counter_id,
41  const string &value);
42 
43 
44 void UpdateCounter(const string &counter_type,
45  const string &counter_id,
46  const string &description,
47  const int32_t &value);
48 
49 
50 void UpdateCounter(const string &counter_type,
51  const string &counter_id,
52  const string &description,
53  const int64_t &value);
54 
55 
56 void UpdateCounter(const string &counter_type,
57  const string &counter_id,
58  const string &description,
59  const double &value);
60 
61 
62 void UpdateCounter(const string &counter_type,
63  const string &counter_id,
64  const string &description,
65  const string &value);
66 
67 
68 void IncreaseCounterBy(const string &counter_type,
69  const string &counter_id,
70  const int32_t &value);
71 
72 
73 void DecreaseCounterBy(const string &counter_type,
74  const string &counter_id,
75  const int32_t &value);
76 
77 
78 void IncreaseCounterBy(const string &counter_type,
79  const string &counter_id,
80  const int64_t &value);
81 
82 
83 void DecreaseCounterBy(const string &counter_type,
84  const string &counter_id,
85  const int64_t &value);
86 
87 
88 void IncreaseCounterBy(const string &counter_type,
89  const string &counter_id,
90  const double &value);
91 
92 
93 void DecreaseCounterBy(const string &counter_type,
94  const string &counter_id,
95  const double &value);
96 
97 
98 int64_t ReadCounterAsInteger(const string &counter_type,
99  const string &counter_id);
100 
101 
102 double ReadCounterAsDouble(const string &counter_type,
103  const string &counter_id);
104 
105 
106 string ReadCounterAsString(const string &counter_type,
107  const string &counter_id);
108 
109 
110 void RegisterCallableCounter(const string &counter_type,
111  const string &counter_id,
112  const string &desc,
113  const CounterCallback &value_cb);
114 
115 void MonitorCounter(const string &counter_type,
116  const string &counter_id,
117  double threshold);
118 
119 } // namespace fun
120 
121 #endif // INCLUDE_FUNAPI_MANAGEMENT_COUNTER_H_