summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstats.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerstats.h')
-rw-r--r--indra/newview/llviewerstats.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 37812f1079..554e4d647e 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -249,7 +249,7 @@ public:
inline F32 getStdDev() const
{
const F32 mean = getMean();
- return (mCount == 0) ? 0.f : sqrt( mSumOfSquares/mCount - (mean * mean) );
+ return (mCount < 2) ? 0.f : sqrt(llmax(0.f,mSumOfSquares/mCount - (mean * mean)));
}
inline U32 getCount() const
@@ -279,7 +279,28 @@ public:
};
StatsAccumulator mAgentPositionSnaps;
-
+
+ // Phase tracking (originally put in for avatar rezzing), tracking
+ // progress of active/completed phases for activities like outfit changing.
+ typedef std::map<std::string,LLFrameTimer> phase_map_t;
+ typedef std::map<std::string,StatsAccumulator> phase_stats_t;
+ class PhaseMap
+ {
+ private:
+ phase_map_t mPhaseMap;
+ static phase_stats_t sStats;
+ public:
+ PhaseMap();
+ LLFrameTimer& getPhaseTimer(const std::string& phase_name);
+ void startPhase(const std::string& phase_name);
+ void stopPhase(const std::string& phase_name);
+ void stopAllPhases();
+ void clearPhases();
+ LLSD dumpPhases();
+ static StatsAccumulator& getPhaseStats(const std::string& phase_name);
+ static void recordPhaseStat(const std::string& phase_name, F32 value);
+ };
+
private:
F64 mStats[ST_COUNT];