#include "performanceclient.hpp" #include #include PerformanceClient::PerformanceClient(std::string name, boost::asio::io_service& io_service, std::string host, std::string port) : node_name(name) , sender(std::unique_ptr(new boost::asio::ip::tcp::socket(io_service))) , timer() { timer.start(); sender.async_connect(host, port, []{}); } void PerformanceClient::send(std::string column) { cmix_proto::Performance perf; perf.set_node(node_name); perf.set_column(column); auto tp = timer.elapsed(); perf.set_wall_time(std::to_string(tp.wall)); perf.set_user_time(std::to_string(tp.user)); perf.set_system_time(std::to_string(tp.system)); sender.async_send(perf); }