From b5688d16b0920aeed3d945fd136a51fe31dfbe24 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Mon, 5 Dec 2016 16:34:37 +0100 Subject: added (untested) statsd for the cmake network. --- statsd/stats.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 statsd/stats.hpp (limited to 'statsd/stats.hpp') diff --git a/statsd/stats.hpp b/statsd/stats.hpp new file mode 100644 index 0000000..673022e --- /dev/null +++ b/statsd/stats.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include "server.hpp" +#include "receiver.hpp" + +#include "cmix.pb.h" + +#include + +#include + +class Stats { + boost::asio::io_service io_service; + Server server; + std::list connections; + + typedef std::vector Column; + typedef std::map Table; + typedef std::map Tables; + + Tables data; + + void accept_connection(std::unique_ptr&& socket); + + void handle_performance(std::list::iterator it, cmix_proto::Performance const& perf); + + void handle_message(std::list::iterator it, cmix_proto::CMixMessage message); + +public: + Stats(ListenSettings lsettings); + + void run(); +}; \ No newline at end of file -- cgit v1.2.3-70-g09d2