diff options
author | Erik Andersson <erik@packy.se> | 2016-11-22 23:56:43 +0100 |
---|---|---|
committer | Erik Andersson <erik@packy.se> | 2016-11-22 23:56:43 +0100 |
commit | 41954fffc10bfd230f857f57c6871b412d5f2e91 (patch) | |
tree | 010bcf28f294a58b4a22b7276cf615758648bcbe /src/report.cpp | |
parent | ed374a8dbcdaaf273964293d2805bdd61b148022 (diff) | |
download | ocelot-master.zip ocelot-master.tar.gz ocelot-master.tar.bz2 |
Diffstat (limited to 'src/report.cpp')
-rw-r--r-- | src/report.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/report.cpp b/src/report.cpp index 97bf753..cd1c1dc 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -7,7 +7,7 @@ #include "response.h" #include "user.h" -std::string report(params_type ¶ms, user_list &users_list) { +std::string report(params_type ¶ms, user_list &users_list, client_opts_t &client_opts) { std::stringstream output; std::string action = params["get"]; if (action == "") { @@ -20,14 +20,16 @@ std::string report(params_type ¶ms, user_list &users_list) { uptime -= up_h * 3600; int up_m = uptime / 60; int up_s = uptime - up_m * 60; - std::string up_ht = up_h <= 9 ? '0' + std::to_string(up_h) : std::to_string(up_h); - std::string up_mt = up_m <= 9 ? '0' + std::to_string(up_m) : std::to_string(up_m); - std::string up_st = up_s <= 9 ? '0' + std::to_string(up_s) : std::to_string(up_s); + std::string up_ht = up_h <= 9 ? '0' + inttostr(up_h) : inttostr(up_h); + std::string up_mt = up_m <= 9 ? '0' + inttostr(up_m) : inttostr(up_m); + std::string up_st = up_s <= 9 ? '0' + inttostr(up_s) : inttostr(up_s); output << "Uptime: " << up_d << " days, " << up_ht << ':' << up_mt << ':' << up_st << '\n' << stats.opened_connections << " connections opened\n" << stats.open_connections << " open connections\n" << stats.connection_rate << " connections/s\n" + << stats.requests << " requests handled\n" + << stats.request_rate << " requests/s\n" << stats.succ_announcements << " successful announcements\n" << (stats.announcements - stats.succ_announcements) << " failed announcements\n" << stats.scrapes << " scrapes\n" @@ -50,5 +52,5 @@ std::string report(params_type ¶ms, user_list &users_list) { output << "Invalid action\n"; } output << "success"; - return response(output.str(), false, false); + return response(output.str(), client_opts); } |