From b3e9c46c94dad0c81a5adcb9152521b5368c66a7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 Aug 2012 22:50:56 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages further cleanup of LLStat removed llfloaterlagmeter --- indra/llcommon/llstat.h | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'indra/llcommon/llstat.h') diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h index 38377a010b..82a246275d 100644 --- a/indra/llcommon/llstat.h +++ b/indra/llcommon/llstat.h @@ -31,22 +31,18 @@ #include "lltimer.h" #include "llframetimer.h" +#include "llinstancetracker.h" class LLSD; // ---------------------------------------------------------------------------- -class LL_COMMON_API LLStat +class LL_COMMON_API LLStat : public LLInstanceTracker { -private: - typedef std::multimap stat_map_t; - - static stat_map_t& getStatList(); - public: - LLStat(std::string name = std::string(), S32 num_bins = 32, BOOL use_frame_timer = FALSE); + LLStat(std::string name = std::string(), BOOL use_frame_timer = FALSE); ~LLStat(); - void start(); // Start the timer for the current "frame", otherwise uses the time tracked from + //void start(); // Start the timer for the current "frame", otherwise uses the time tracked from // the last addValue void reset(); void addValue(const F32 value = 1.f); // Adds the current value being tracked, and tracks the DT. @@ -57,23 +53,24 @@ public: F32 getPrev(S32 age) const; // Age is how many "addValues" previously - zero is current F32 getPrevPerSec(S32 age) const; // Age is how many "addValues" previously - zero is current + F32 getCurrent() const; F32 getCurrentPerSec() const; F32 getMin() const; F32 getMinPerSec() const; + F32 getMean() const; F32 getMeanPerSec() const; - F32 getMeanDuration() const; + F32 getMax() const; F32 getMaxPerSec() const; U32 getNumValues() const; S32 getNumBins() const; - F64 getLastTime() const; private: - BOOL mUseFrameTimer; + bool mUseFrameTimer; U32 mNumValues; U32 mNumBins; F32 mLastValue; @@ -93,6 +90,7 @@ private: F32 mDT; }; ValueEntry* mBins; + S32 mCurBin; S32 mNextBin; @@ -100,17 +98,6 @@ private: static LLTimer sTimer; static LLFrameTimer sFrameTimer; - -public: - static LLStat* getStat(const std::string& name) - { - // return the first stat that matches 'name' - stat_map_t::iterator iter = getStatList().find(name); - if (iter != getStatList().end()) - return iter->second; - else - return NULL; - } }; #endif // LL_STAT_ -- cgit v1.2.3 From 819adb5eb4d7f982121f3dbd82750e05d26864d9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 00:26:44 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system final removal of remaining LLStat code --- indra/llcommon/llstat.h | 103 ------------------------------------------------ 1 file changed, 103 deletions(-) delete mode 100644 indra/llcommon/llstat.h (limited to 'indra/llcommon/llstat.h') diff --git a/indra/llcommon/llstat.h b/indra/llcommon/llstat.h deleted file mode 100644 index 82a246275d..0000000000 --- a/indra/llcommon/llstat.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @file llstat.h - * @brief Runtime statistics accumulation. - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLSTAT_H -#define LL_LLSTAT_H - -#include - -#include "lltimer.h" -#include "llframetimer.h" -#include "llinstancetracker.h" - -class LLSD; - -// ---------------------------------------------------------------------------- -class LL_COMMON_API LLStat : public LLInstanceTracker -{ -public: - LLStat(std::string name = std::string(), BOOL use_frame_timer = FALSE); - ~LLStat(); - - //void start(); // Start the timer for the current "frame", otherwise uses the time tracked from - // the last addValue - void reset(); - void addValue(const F32 value = 1.f); // Adds the current value being tracked, and tracks the DT. - void addValue(const S32 value) { addValue((F32)value); } - void addValue(const U32 value) { addValue((F32)value); } - - S32 getNextBin() const; - - F32 getPrev(S32 age) const; // Age is how many "addValues" previously - zero is current - F32 getPrevPerSec(S32 age) const; // Age is how many "addValues" previously - zero is current - - F32 getCurrent() const; - F32 getCurrentPerSec() const; - - F32 getMin() const; - F32 getMinPerSec() const; - - F32 getMean() const; - F32 getMeanPerSec() const; - - F32 getMax() const; - F32 getMaxPerSec() const; - - U32 getNumValues() const; - S32 getNumBins() const; - -private: - bool mUseFrameTimer; - U32 mNumValues; - U32 mNumBins; - F32 mLastValue; - F64 mLastTime; - - struct ValueEntry - { - ValueEntry() - : mValue(0.f), - mBeginTime(0.0), - mTime(0.0), - mDT(0.f) - {} - F32 mValue; - F64 mBeginTime; - F64 mTime; - F32 mDT; - }; - ValueEntry* mBins; - - S32 mCurBin; - S32 mNextBin; - - std::string mName; - - static LLTimer sTimer; - static LLFrameTimer sFrameTimer; -}; - -#endif // LL_STAT_ -- cgit v1.2.3