diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2008-09-05 22:03:35 +0000 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2008-09-05 22:03:35 +0000 |
commit | 222bca24c12e162669c1a810c3102811f21cfbe4 (patch) | |
tree | 8eee52c0ffd4e9b03d624fc78d6547b8312a5c85 /indra/llcommon/llstat.h | |
parent | 1493a212629b02a4323bf0c1f5a6960bc7b5e271 (diff) |
svn merge -r95288:95907 svn+ssh://svn.lindenlab.com/svn/linden/qa/maint-server/qar-841
this is a combined mergeback of the following branches as per QAR-841:
maint-server/maint-server-1 (absorbed by maint-server-2)
maint-server/maint-server-2
maint-server/maint-server-3
havok4/havok4-8
havok4/havok4-9
yes dataserver-is-deprecated
Diffstat (limited to 'indra/llcommon/llstat.h')
-rw-r--r-- | indra/llcommon/llstat.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h index 5fa46fca75..d4dcb3a961 100644 --- a/indra/llcommon/llstat.h +++ b/indra/llcommon/llstat.h @@ -67,6 +67,9 @@ public: NUM_SCALES }; + static const TimeScale IMPL_NUM_SCALES = (TimeScale)(SCALE_TWO_MINUTE + 1); + static U64 sScaleTimes[IMPL_NUM_SCALES]; + F32 meanValue(TimeScale scale) const; // see the subclasses for the specific meaning of value @@ -74,9 +77,32 @@ public: F32 meanValueOverLastSecond() const { return meanValue(SCALE_SECOND); } F32 meanValueOverLastMinute() const { return meanValue(SCALE_MINUTE); } -protected: - class impl; - impl& m; + void reset(U64 when); + + void sum(F64 value); + void sum(F64 value, U64 when); + + U64 getCurrentUsecs() const; + // Get current microseconds based on timer type + + BOOL mUseFrameTimer; + + BOOL mRunning; + U64 mLastTime; + + struct Bucket + { + F64 accum; + U64 endTime; + + BOOL lastValid; + F64 lastAccum; + }; + + Bucket mBuckets[IMPL_NUM_SCALES]; + + BOOL mLastSampleValid; + F64 mLastSampleValue; }; class LLStatMeasure : public LLStatAccum @@ -105,7 +131,7 @@ public: void count(U32); // used to note that n items have occured - void mark() { count(1); } + void mark(); // used for counting the rate thorugh a point in the code }; @@ -119,6 +145,9 @@ class LLStatTime : public LLStatAccum public: LLStatTime(bool use_frame_timer = false); + U32 mFrameNumber; // Current frame number + U64 mTotalTimeInFrame; // Total time (microseconds) accumulated during the last frame + private: void start(); void stop(); |