A simple StatsdClient.
More...
#include <StatsdClient.h>
|
| | StatsdClient (const String &nm="", const String &hostname="127.0.0.1", uint16_t port=8125) |
| |
| | StatsdClient (const net::IPAddress &ip, const String &nm="", uint16_t port=8125) |
| |
| virtual | ~StatsdClient () |
| |
| const String | getNamespace () const |
| |
| void | Count (const String &stat, size_t value, float sample_rate=1.0) const |
| |
| void | Increment (const String &stat, float sample_rate=1.0) const |
| |
| void | Decrement (const String &stat, float sample_rate=1.0) const |
| |
| void | Gauge (const String &stat, size_t value, float sample_rate=1.0) const |
| |
| void | Timing (const String &stat, size_t ms, float sample_rate=1.0) const |
| |
A simple StatsdClient.
- Note
- This is really just a simple C++ wrapper around https://github.com/romanbsd/statsd-c-client
| trippingcyril::StatsdClient::StatsdClient |
( |
const String & |
nm = "", |
|
|
const String & |
hostname = "127.0.0.1", |
|
|
uint16_t |
port = 8125 |
|
) |
| |
- Parameters
-
| nm | namespace to use within statsd |
| hostname | The hostname of the statsd instance |
| port | The port to use |
- Exceptions
-
| std::runtime_error | If the socket() system call failed |
| std::runtime_error | If getaddrinfo() failed |
| trippingcyril::StatsdClient::StatsdClient |
( |
const net::IPAddress & |
ip, |
|
|
const String & |
nm = "", |
|
|
uint16_t |
port = 8125 |
|
) |
| |
- Parameters
-
| ip | The ip address to connect to |
| nm | Namespace to use within statsd |
| port | The port to use |
- Exceptions
-
| std::runtime_error | If the socket() system call failed |
| std::runtime_error | If the ip version isn't implemented correctly just yet |
| virtual trippingcyril::StatsdClient::~StatsdClient |
( |
| ) |
|
|
virtual |
| void trippingcyril::StatsdClient::Count |
( |
const String & |
stat, |
|
|
size_t |
value, |
|
|
float |
sample_rate = 1.0 |
|
) |
| const |
| void trippingcyril::StatsdClient::Decrement |
( |
const String & |
stat, |
|
|
float |
sample_rate = 1.0 |
|
) |
| const |
| void trippingcyril::StatsdClient::Gauge |
( |
const String & |
stat, |
|
|
size_t |
value, |
|
|
float |
sample_rate = 1.0 |
|
) |
| const |
| const String trippingcyril::StatsdClient::getNamespace |
( |
| ) |
const |
|
inline |
- Returns
- The namespace for this statd object
| void trippingcyril::StatsdClient::Increment |
( |
const String & |
stat, |
|
|
float |
sample_rate = 1.0 |
|
) |
| const |
| void trippingcyril::StatsdClient::Timing |
( |
const String & |
stat, |
|
|
size_t |
ms, |
|
|
float |
sample_rate = 1.0 |
|
) |
| const |
| bool trippingcyril::StatsdClient::DRY_RUN |
|
static |
The documentation for this class was generated from the following file: