mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Use the new uptime code. Replace slow, non-monotonic 'time(NULL)' calls
with fast, almost-always-monotonic 'upTime()' calls.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "types.h"
|
||||
extern int upTime();
|
||||
|
||||
// Monitors load levels and response times
|
||||
|
||||
@@ -19,7 +20,7 @@ protected:
|
||||
uint64 mLatencyMSPeak;
|
||||
uint64 mTargetLatencyAvg;
|
||||
uint64 mTargetLatencyPk;
|
||||
time_t mLastUpdate;
|
||||
int mLastUpdate;
|
||||
boost::mutex mLock;
|
||||
|
||||
void update();
|
||||
@@ -27,7 +28,7 @@ protected:
|
||||
public:
|
||||
LoadMonitor() : mCounts(0), mLatencyEvents(0), mLatencyMSAvg(0), mLatencyMSPeak(0),
|
||||
mTargetLatencyAvg(0), mTargetLatencyPk(0)
|
||||
{ mLastUpdate = time(NULL); }
|
||||
{ mLastUpdate = upTime(); }
|
||||
|
||||
void addCount(int counts);
|
||||
void addLatency(int latency);
|
||||
|
||||
Reference in New Issue
Block a user