summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPuck Meerburg <puck@puckipedia.com>2018-03-10 20:44:09 +0100
committerPuck Meerburg <puck@puckipedia.com>2018-03-10 20:44:09 +0100
commit56a1ef63e7f2628ad92a5040b3acae64cd99b56a (patch)
treeb6b3a5d7deb44408b9189e9ad2e9d93ea6817194 /src
parent27e92622b5655c3ecf3182bc511adfb8a07b8722 (diff)
Add Haiku support
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_stats.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index ef6a12d34..878ea2fae 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -239,12 +239,13 @@ void CommandStats::DoStats(Stats::Context& stats)
/* Not sure why we were doing '0' with a RUSAGE_SELF comment rather than just using RUSAGE_SELF -- Om */
if (!getrusage(RUSAGE_SELF,&R)) /* RUSAGE_SELF */
{
+#ifndef __HAIKU__
stats.AddRow(249, "Total allocation: "+ConvToStr(R.ru_maxrss)+"K");
stats.AddRow(249, "Signals: "+ConvToStr(R.ru_nsignals));
stats.AddRow(249, "Page faults: "+ConvToStr(R.ru_majflt));
stats.AddRow(249, "Swaps: "+ConvToStr(R.ru_nswap));
stats.AddRow(249, "Context Switches: Voluntary; "+ConvToStr(R.ru_nvcsw)+" Involuntary; "+ConvToStr(R.ru_nivcsw));
-
+#endif
float n_elapsed = (ServerInstance->Time() - ServerInstance->stats.LastSampled.tv_sec) * 1000000
+ (ServerInstance->Time_ns() - ServerInstance->stats.LastSampled.tv_nsec) / 1000;
float n_eaten = ((R.ru_utime.tv_sec - ServerInstance->stats.LastCPU.tv_sec) * 1000000 + R.ru_utime.tv_usec - ServerInstance->stats.LastCPU.tv_usec);