filesaver
|
#include <StatsdClient.h>
Public Member Functions | |
Constructor and destructor | |
StatsdClient (const std::string &host, const uint16_t port, const std::string &prefix, const std::optional< uint64_t > batchSize=std::nullopt) noexcept | |
Constructor. More... | |
Methods | |
void | setConfig (const std::string &host, const uint16_t port, const std::string &prefix) noexcept |
Sets a configuration { host, port, prefix }. More... | |
std::optional< std::string > | errorMessage () const noexcept |
Returns the error message as an optional std::string. More... | |
void | increment (const std::string &key, const float frequency=1.0f) const noexcept |
Increments the key, at a given frequency rate. More... | |
void | decrement (const std::string &key, const float frequency=1.0f) const noexcept |
Increments the key, at a given frequency rate. More... | |
void | count (const std::string &key, const int delta, const float frequency=1.0f) const noexcept |
Adjusts the specified key by a given delta, at a given frequency rate. More... | |
void | gauge (const std::string &key, const unsigned int value, const float frequency=1.0f) const noexcept |
Records a gauge for the key, with a given value, at a given frequency rate. More... | |
void | timing (const std::string &key, const unsigned int ms, const float frequency=1.0f) const noexcept |
Records a timing for a key, at a given frequency. More... | |
void | send (const std::string &key, const int value, const std::string &type, const float frequency=1.0f) const noexcept |
Send a value for a key, according to its type, at a given frequency. More... | |
Statsd client
This is the Statsd client, exposing the classic methods and relying on a UDP sender for the actual sending.
The sampling frequency can be input, as well as the batching size. The latter is optional and shall not be set if batching is not desired.
Definition at line 42 of file StatsdClient.h.
|
noexcept |
Constructor.
Definition at line 25 of file StatsdClient.cpp.
|
noexcept |
Adjusts the specified key by a given delta, at a given frequency rate.
Definition at line 56 of file StatsdClient.cpp.
|
noexcept |
Increments the key, at a given frequency rate.
Definition at line 46 of file StatsdClient.cpp.
|
noexcept |
Returns the error message as an optional std::string.
Definition at line 41 of file StatsdClient.cpp.
|
noexcept |
Records a gauge for the key, with a given value, at a given frequency rate.
Definition at line 61 of file StatsdClient.cpp.
|
noexcept |
Increments the key, at a given frequency rate.
Definition at line 51 of file StatsdClient.cpp.
|
noexcept |
Send a value for a key, according to its type, at a given frequency.
Definition at line 71 of file StatsdClient.cpp.
|
noexcept |
Sets a configuration { host, port, prefix }.
Definition at line 35 of file StatsdClient.cpp.
|
noexcept |
Records a timing for a key, at a given frequency.
Definition at line 66 of file StatsdClient.cpp.