You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](http://isitmaintained.com/project/vthiery/cpp-statsd-client"Average time to resolve an issue")
9
9
10
10
A header-only StatsD client implemented in C++.
11
11
The client allows:
12
+
12
13
- batching,
13
14
- change of configuration at runtime,
14
15
- user-defined frequency rate.
@@ -19,22 +20,24 @@ The client allows:
19
20
20
21
In order to install the header files and/or run the tests, simply use the Makefile and execute
21
22
23
+
```sh
24
+
make install
22
25
```
23
-
make install
24
-
```
25
26
26
27
and
27
28
29
+
```sh
30
+
make test
28
31
```
29
-
make test
30
-
```
31
32
32
33
### Conan
33
34
34
35
If you are using [Conan](https://www.conan.io/) to manage your dependencies, merely add statsdclient/x.y.z@vthiery/stable to your conanfile.py's requires, where x.y.z is the release version you want to use. Please file issues here if you experience problems with the packages. You can also directly download the latest version [here](https://bintray.com/vthiery/conan-packages/statsdclient%3Avthiery/_latestVersion).
35
36
36
37
## Usage
38
+
37
39
### Example
40
+
38
41
A simple example of how to use the client:
39
42
40
43
```cpp
@@ -93,19 +96,21 @@ The batchsize is the only parameter that cannot be changed for the time being.
93
96
### Batching
94
97
95
98
The client supports batching of the metrics:
96
-
* the unit of the batching parameter is bytes,
97
-
* it is optional and not setting it will result in an immediate send of any metrics,
99
+
100
+
- the unit of the batching parameter is bytes,
101
+
- it is optional and not setting it will result in an immediate send of any metrics,
98
102
99
103
If set, the UDP sender will spawn a thread sending the metrics to the server every 1 second by aggregates. The aggregation logic is as follows:
100
-
* if the last message has already reached the batching limit, add a new element in a message queue;
101
-
* otherwise, append the message to the last one, separated by a `\n`.
104
+
105
+
- if the last message has already reached the batching limit, add a new element in a message queue;
106
+
- otherwise, append the message to the last one, separated by a `\n`.
102
107
103
108
### Frequency rate
104
109
105
110
When sending a metric, a frequency rate can be set in order to limit the metrics' sampling. By default, the frequency rate is set to one and won't affect the sampling. If set to a value `epsilon` (0.0001 for the time being) close to one, the sampling is not affected either.
106
111
107
112
If the frequency rate is set and `epsilon` different from one, the sending will be rejected randomly (the higher the frequency rate, the lower the probability of rejection).
0 commit comments