summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-04-09 17:57:50 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-04-09 17:57:50 -0400
commite4cced82343391292e61db03bb019e19827834c7 (patch)
treea9f737b1c64b9a60ade9c4296d0afd8bf3e1b96a
parent7d739fbe5b5f53fdc9dc5bfc1358906cca44fc05 (diff)
SH-3064 FIX - added cloud and cloud-or-gray stats to summary metrics. Moved summary metrics out of per-region info. Removed phase stats from avatar appearance change msg.
-rwxr-xr-xindra/newview/llviewerassetstats.cpp27
-rwxr-xr-xindra/newview/llviewerassetstats.h9
-rwxr-xr-xindra/newview/llvoavatar.cpp2
-rwxr-xr-xindra/newview/llvoavatar.h5
-rwxr-xr-xindra/newview/tests/llviewerassetstats_test.cpp33
5 files changed, 52 insertions, 24 deletions
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index 9e627a5c61..f408d06f4c 100755
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -160,7 +160,9 @@ LLViewerAssetStats::LLViewerAssetStats()
LLViewerAssetStats::LLViewerAssetStats(const LLViewerAssetStats & src)
: mRegionHandle(src.mRegionHandle),
- mResetTimestamp(src.mResetTimestamp)
+ mResetTimestamp(src.mResetTimestamp),
+ mPhaseStats(src.mPhaseStats),
+ mAvatarRezStates(src.mAvatarRezStates)
{
const PerRegionContainer::const_iterator it_end(src.mRegionStats.end());
for (PerRegionContainer::const_iterator it(src.mRegionStats.begin()); it_end != it; ++it)
@@ -261,7 +263,10 @@ LLViewerAssetStats::recordAvatarStats()
{
std::vector<S32> rez_counts;
LLVOAvatar::getNearbyRezzedStats(rez_counts);
- mCurRegionStats->mAvatarRezStates = rez_counts;
+ mAvatarRezStates = rez_counts;
+ mPhaseStats.clear();
+ mPhaseStats["cloud"] = LLVOAvatar::getPhaseStats("cloud");
+ mPhaseStats["cloud-or-gray"] = LLVOAvatar::getPhaseStats("cloud-or-gray");
}
LLSD
@@ -297,6 +302,7 @@ LLViewerAssetStats::asLLSD(bool compact_output)
// Avatar sub-tags
static const LLSD::String avatar_tag("avatar");
static const LLSD::String avatar_nearby_tag("nearby");
+ static const LLSD::String avatar_phase_stats_tag("phase_stats");
const duration_t now = LLViewerAssetStatsFF::get_timestamp();
mCurRegionStats->accumulateTime(now);
@@ -345,13 +351,6 @@ LLViewerAssetStats::asLLSD(bool compact_output)
slot[max_tag] = LLSD(F64(stats.mFPS.getMax()));
slot[mean_tag] = LLSD(F64(stats.mFPS.getMean()));
}
- reg_stat[avatar_tag][avatar_nearby_tag] = LLSD::emptyArray();
- for (S32 rez_stat=0; rez_stat < stats.mAvatarRezStates.size(); ++rez_stat)
- {
- std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat);
- reg_stat["nearby"][rez_status_name] = stats.mAvatarRezStates[rez_stat];
- }
-
U32 grid_x(0), grid_y(0);
grid_from_region_handle(it->first, &grid_x, &grid_y);
reg_stat["grid_x"] = LLSD::Integer(grid_x);
@@ -363,6 +362,16 @@ LLViewerAssetStats::asLLSD(bool compact_output)
LLSD ret = LLSD::emptyMap();
ret["regions"] = regions;
ret["duration"] = LLSD::Real((now - mResetTimestamp) * 1.0e-6);
+ LLSD avatar_info;
+ avatar_info[avatar_nearby_tag] = LLSD::emptyArray();
+ for (S32 rez_stat=0; rez_stat < mAvatarRezStates.size(); ++rez_stat)
+ {
+ std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat);
+ avatar_info[avatar_nearby_tag][rez_status_name] = mAvatarRezStates[rez_stat];
+ }
+ avatar_info[avatar_phase_stats_tag]["cloud"] = mPhaseStats["cloud"].getData();
+ avatar_info[avatar_phase_stats_tag]["cloud-or-gray"] = mPhaseStats["cloud-or-gray"].getData();
+ ret[avatar_tag] = avatar_info;
return ret;
}
diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h
index 6cb0cc4060..4b278bc2a2 100755
--- a/indra/newview/llviewerassetstats.h
+++ b/indra/newview/llviewerassetstats.h
@@ -36,6 +36,7 @@
#include "llviewerassetstorage.h"
#include "llsimplestat.h"
#include "llsd.h"
+#include "llvoavatar.h"
/**
* @class LLViewerAssetStats
@@ -125,8 +126,7 @@ public:
mRegionHandle(src.mRegionHandle),
mTotalTime(src.mTotalTime),
mStartTimestamp(src.mStartTimestamp),
- mFPS(src.mFPS),
- mAvatarRezStates(src.mAvatarRezStates)
+ mFPS(src.mFPS)
{
for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i)
{
@@ -149,7 +149,6 @@ public:
duration_t mTotalTime;
duration_t mStartTimestamp;
LLSimpleStatMMM<> mFPS;
- std::vector<S32> mAvatarRezStates;
struct prs_group
{
@@ -257,6 +256,10 @@ protected:
// Time of last reset
duration_t mResetTimestamp;
+
+ // Nearby avatar stats
+ std::vector<S32> mAvatarRezStates;
+ LLVOAvatar::phase_stats_t mPhaseStats;
};
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index abbe25175a..46805ec0c6 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6595,7 +6595,7 @@ void LLVOAvatar::updateRezzedStatusTimers()
S32 rez_status = getRezzedStatus();
if (rez_status != mLastRezzedStatus)
{
- llinfos << avString() << "zxx rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl;
+ llinfos << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl;
bool is_cloud_or_gray = (rez_status==0 || rez_status==1);
bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1);
bool is_cloud = (rez_status==0);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 7a1b780862..8b72682040 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -330,9 +330,12 @@ private:
LLFrameTimer mRuthTimer;
// TODO move all the phase stuff to its down data structure.
+public:
+ typedef std::map<std::string,LLViewerStats::StatsAccumulator> phase_stats_t;
typedef std::map<std::string,LLFrameTimer> phase_map_t;
+
+private:
phase_map_t mPhases;
- typedef std::map<std::string,LLViewerStats::StatsAccumulator> phase_stats_t;
static phase_stats_t sPhaseStats;
protected:
diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp
index 56d2004c17..356c5b8261 100755
--- a/indra/newview/tests/llviewerassetstats_test.cpp
+++ b/indra/newview/tests/llviewerassetstats_test.cpp
@@ -45,6 +45,12 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)
counts[2] = 1;
}
+LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name)
+{
+ static std::map<std::string,LLViewerStats::StatsAccumulator> stats_map;
+ return stats_map[phase_name];
+}
+
// static
std::string LLVOAvatar::rezStatusToString(S32 rez_status)
{
@@ -131,9 +137,16 @@ is_double_key_map(const LLSD & sd, const std::string & key1, const std::string &
}
static bool
+is_triple_key_map(const LLSD & sd, const std::string & key1, const std::string & key2, const std::string& key3)
+{
+ return sd.isMap() && 3 == sd.size() && sd.has(key1) && sd.has(key2) && sd.has(key3);
+}
+
+
+static bool
is_no_stats_map(const LLSD & sd)
{
- return is_double_key_map(sd, "duration", "regions");
+ return is_triple_key_map(sd, "duration", "regions", "avatar");
}
static bool
@@ -244,7 +257,7 @@ namespace tut
// Once the region is set, we will get a response even with no data collection
it->setRegion(region1_handle);
sd_full = it->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd_full, "duration", "regions"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd_full, "duration", "regions", "avatar"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd_full["regions"], region1_handle));
LLSD sd = sd_full["regions"][0];
@@ -285,7 +298,7 @@ namespace tut
it->setRegion(region1_handle);
LLSD sd = it->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = sd[0];
@@ -310,7 +323,7 @@ namespace tut
LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false);
LLSD sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = sd["regions"][0];
@@ -350,7 +363,7 @@ namespace tut
LLSD sd = gViewerAssetStatsThread1->asLLSD(false);
ensure("Other collector is empty", is_no_stats_map(sd));
sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = sd["regions"][0];
@@ -400,7 +413,7 @@ namespace tut
// std::cout << sd << std::endl;
- ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions"));
+ ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar"));
ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle));
LLSD sd1 = get_region(sd, region1_handle);
LLSD sd2 = get_region(sd, region2_handle);
@@ -423,7 +436,7 @@ namespace tut
// Reset leaves current region in place
gViewerAssetStatsMain->reset();
sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar"));
ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle));
sd2 = sd["regions"][0];
@@ -472,7 +485,7 @@ namespace tut
LLSD sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions"));
+ ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar"));
ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle));
LLSD sd1 = get_region(sd, region1_handle);
LLSD sd2 = get_region(sd, region2_handle);
@@ -495,7 +508,7 @@ namespace tut
// Reset leaves current region in place
gViewerAssetStatsMain->reset();
sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "duration", "regions"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar"));
ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle));
sd2 = get_region(sd, region2_handle);
ensure("Region2 is present in results", sd2.isMap());
@@ -541,7 +554,7 @@ namespace tut
LLSD sd = gViewerAssetStatsThread1->asLLSD(false);
ensure("Other collector is empty", is_no_stats_map(sd));
sd = gViewerAssetStatsMain->asLLSD(false);
- ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration"));
+ ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar"));
ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle));
sd = get_region(sd, region1_handle);
ensure("Region1 is present in results", sd.isMap());