summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappcorehttp.cpp3
-rw-r--r--indra/newview/llfasttimerview.cpp4
-rw-r--r--indra/newview/llviewerstats.h86
3 files changed, 8 insertions, 85 deletions
diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp
index c1f898284a..261a7b5ad9 100644
--- a/indra/newview/llappcorehttp.cpp
+++ b/indra/newview/llappcorehttp.cpp
@@ -39,6 +39,7 @@
#include <curl/curl.h>
#include "llcorehttputil.h"
+#include "httpstats.h"
// Here is where we begin to get our connection usage under control.
// This establishes llcorehttp policy classes that, among other
@@ -313,6 +314,8 @@ void LLAppCoreHttp::requestStop()
void LLAppCoreHttp::cleanup()
{
+ LLCore::HTTPStats::instance().dumpStats();
+
if (LLCORE_HTTP_HANDLE_INVALID == mStopHandle)
{
// Should have been started already...
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index a69b3b7dc7..91501ccb1f 100644
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -796,13 +796,13 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is)
for(stats_map_t::iterator it = time_stats.begin(); it != time_stats.end(); ++it)
{
std::string label = it->first;
- ret[label]["TotalTime"] = time_stats[label].mSum;
+ ret[label]["TotalTime"] = time_stats[label].getSum();
ret[label]["MeanTime"] = time_stats[label].getMean();
ret[label]["MaxTime"] = time_stats[label].getMaxValue();
ret[label]["MinTime"] = time_stats[label].getMinValue();
ret[label]["StdDevTime"] = time_stats[label].getStdDev();
- ret[label]["Samples"] = sample_stats[label].mSum;
+ ret[label]["Samples"] = sample_stats[label].getSum();
ret[label]["MaxSamples"] = sample_stats[label].getMaxValue();
ret[label]["MinSamples"] = sample_stats[label].getMinValue();
ret[label]["StdDevSamples"] = sample_stats[label].getStdDev();
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 97a060d95e..d8d92d61d3 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -30,7 +30,7 @@
#include "lltextureinfo.h"
#include "lltracerecording.h"
#include "lltrace.h"
-
+#include "llstatsaccumulator.h"
enum ESimStatID
{
@@ -256,89 +256,9 @@ public:
void addToMessage(LLSD &body);
- struct StatsAccumulator
- {
- S32 mCount;
- F32 mSum;
- F32 mSumOfSquares;
- F32 mMinValue;
- F32 mMaxValue;
- U32 mCountOfNextUpdatesToIgnore;
-
- inline StatsAccumulator()
- {
- reset();
- }
-
- inline void push( F32 val )
- {
- if ( mCountOfNextUpdatesToIgnore > 0 )
- {
- mCountOfNextUpdatesToIgnore--;
- return;
- }
-
- mCount++;
- mSum += val;
- mSumOfSquares += val * val;
- if (mCount == 1 || val > mMaxValue)
- {
- mMaxValue = val;
- }
- if (mCount == 1 || val < mMinValue)
- {
- mMinValue = val;
- }
- }
-
- inline F32 getMean() const
- {
- return (mCount == 0) ? 0.f : ((F32)mSum)/mCount;
- }
-
- inline F32 getMinValue() const
- {
- return mMinValue;
- }
-
- inline F32 getMaxValue() const
- {
- return mMaxValue;
- }
-
- inline F32 getStdDev() const
- {
- const F32 mean = getMean();
- return (mCount < 2) ? 0.f : sqrt(llmax(0.f,mSumOfSquares/mCount - (mean * mean)));
- }
-
- inline U32 getCount() const
- {
- return mCount;
- }
-
- inline void reset()
- {
- mCount = 0;
- mSum = mSumOfSquares = 0.f;
- mMinValue = 0.0f;
- mMaxValue = 0.0f;
- mCountOfNextUpdatesToIgnore = 0;
- }
-
- inline LLSD asLLSD() const
- {
- LLSD data;
- data["mean"] = getMean();
- data["std_dev"] = getStdDev();
- data["count"] = (S32)mCount;
- data["min"] = getMinValue();
- data["max"] = getMaxValue();
- return data;
- }
- };
+ typedef LLStatsAccumulator StatsAccumulator;
- // Phase tracking (originally put in for avatar rezzing), tracking
+ // Phase tracking (originally put in for avatar rezzing), tracking
// progress of active/completed phases for activities like outfit changing.
typedef std::map<std::string,LLTimer> phase_map_t;
typedef std::map<std::string,StatsAccumulator> phase_stats_t;