@@ -26,45 +26,45 @@ static constexpr int MAX_STATSD_PERIOD{60 * 60};
2626
2727namespace statsd {
2828class StatsdClient {
29- public:
30- explicit StatsdClient (const std::string& host, const std::string& nodename, uint16_t port,
31- const std::string& ns, bool enabled);
29+ public:
30+ explicit StatsdClient (const std::string& host, const std::string& nodename, uint16_t port,
31+ const std::string& ns, bool enabled);
3232
33- public:
34- bool inc (const std::string& key, float sample_rate = 1 .f);
35- bool dec (const std::string& key, float sample_rate = 1 .f);
36- bool count (const std::string& key, int64_t value, float sample_rate = 1 .f);
37- bool gauge (const std::string& key, int64_t value, float sample_rate = 1 .f);
38- bool gaugeDouble (const std::string& key, double value, float sample_rate = 1 .f);
39- bool timing (const std::string& key, int64_t ms, float sample_rate = 1 .f);
33+ public:
34+ bool inc (const std::string& key, float sample_rate = 1 .f);
35+ bool dec (const std::string& key, float sample_rate = 1 .f);
36+ bool count (const std::string& key, int64_t value, float sample_rate = 1 .f);
37+ bool gauge (const std::string& key, int64_t value, float sample_rate = 1 .f);
38+ bool gaugeDouble (const std::string& key, double value, float sample_rate = 1 .f);
39+ bool timing (const std::string& key, int64_t ms, float sample_rate = 1 .f);
4040
41- /* (Low Level Api) manually send a message
42- * type = "c", "g" or "ms"
43- */
44- bool send (std::string key, int64_t value, const std::string& type, float sample_rate);
45- bool sendDouble (std::string key, double value, const std::string& type, float sample_rate);
41+ /* (Low Level Api) manually send a message
42+ * type = "c", "g" or "ms"
43+ */
44+ bool send (std::string key, int64_t value, const std::string& type, float sample_rate);
45+ bool sendDouble (std::string key, double value, const std::string& type, float sample_rate);
4646
47- private:
48- /* *
49- * (Low Level Api) manually send a message
50- * which might be composed of several lines.
51- */
52- bool send (const std::string& message);
47+ private:
48+ /* *
49+ * (Low Level Api) manually send a message
50+ * which might be composed of several lines.
51+ */
52+ bool send (const std::string& message);
5353
54- void cleanup (std::string& key);
55- bool ShouldSend (float sample_rate);
54+ void cleanup (std::string& key);
55+ bool ShouldSend (float sample_rate);
5656
57- private:
58- mutable Mutex cs;
59- mutable FastRandomContext insecure_rand GUARDED_BY (cs);
57+ private:
58+ mutable Mutex cs;
59+ mutable FastRandomContext insecure_rand GUARDED_BY (cs);
6060
61- std::unique_ptr<Sock> m_sock{nullptr };
62- std::pair<struct sockaddr_storage , socklen_t > m_server{{}, sizeof (struct sockaddr_storage )};
61+ std::unique_ptr<Sock> m_sock{nullptr };
62+ std::pair<struct sockaddr_storage , socklen_t > m_server{{}, sizeof (struct sockaddr_storage )};
6363
64- const uint16_t m_port;
65- const std::string m_host;
66- const std::string m_nodename;
67- const std::string m_ns;
64+ const uint16_t m_port;
65+ const std::string m_host;
66+ const std::string m_nodename;
67+ const std::string m_ns;
6868};
6969} // namespace statsd
7070
0 commit comments