summaryrefslogtreecommitdiff
path: root/src/commands/cmd_stats.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-08 22:40:30 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-08 22:40:30 +0100
commit689996cb8856af43a033eb5ca1cb9df7475c0854 (patch)
tree258bbb81046a8cefe49a65d4f15ea36779352261 /src/commands/cmd_stats.cpp
parentaea38a0dd702895b7dfd18efd26a0dcead2279fc (diff)
Move socketengine stats into a new class
Diffstat (limited to 'src/commands/cmd_stats.cpp')
-rw-r--r--src/commands/cmd_stats.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp
index 617f0a320..afcbe01e6 100644
--- a/src/commands/cmd_stats.cpp
+++ b/src/commands/cmd_stats.cpp
@@ -181,11 +181,14 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
ServerInstance->XLines->InvokeStats("E",223,user,results);
break;
case 'E':
- results.push_back("249 "+user->nick+" :Total events: "+ConvToStr(ServerInstance->SE->TotalEvents));
- results.push_back("249 "+user->nick+" :Read events: "+ConvToStr(ServerInstance->SE->ReadEvents));
- results.push_back("249 "+user->nick+" :Write events: "+ConvToStr(ServerInstance->SE->WriteEvents));
- results.push_back("249 "+user->nick+" :Error events: "+ConvToStr(ServerInstance->SE->ErrorEvents));
- break;
+ {
+ const SocketEngine::Statistics& stats = ServerInstance->SE->GetStats();
+ results.push_back("249 "+user->nick+" :Total events: "+ConvToStr(stats.TotalEvents));
+ results.push_back("249 "+user->nick+" :Read events: "+ConvToStr(stats.ReadEvents));
+ results.push_back("249 "+user->nick+" :Write events: "+ConvToStr(stats.WriteEvents));
+ results.push_back("249 "+user->nick+" :Error events: "+ConvToStr(stats.ErrorEvents));
+ break;
+ }
/* stats m (list number of times each command has been used, plus bytecount) */
case 'm':
@@ -209,7 +212,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
float kbitpersec_in, kbitpersec_out, kbitpersec_total;
char kbitpersec_in_s[30], kbitpersec_out_s[30], kbitpersec_total_s[30];
- ServerInstance->SE->GetStats(kbitpersec_in, kbitpersec_out, kbitpersec_total);
+ ServerInstance->SE->GetStats().GetBandwidth(kbitpersec_in, kbitpersec_out, kbitpersec_total);
snprintf(kbitpersec_total_s, 30, "%03.5f", kbitpersec_total);
snprintf(kbitpersec_out_s, 30, "%03.5f", kbitpersec_out);