diff options
Diffstat (limited to 'indra')
| -rwxr-xr-x[-rw-r--r--] | indra/newview/CMakeLists.txt | 0 | ||||
| -rw-r--r-- | indra/newview/llappviewer.cpp | 1 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llviewerassetstats.cpp | 29 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/llviewerassetstats.h | 8 | ||||
| -rwxr-xr-x | indra/newview/llvoavatarself.cpp | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | indra/newview/tests/llviewerassetstats_test.cpp | 9 | 
6 files changed, 47 insertions, 2 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f85b943c70..f85b943c70 100644..100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3f511748ea..bea8303d69 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4197,6 +4197,7 @@ void LLAppViewer::idle()  			// The 5-second interval is nice for this purpose.  If the object debug  			// bit moves or is disabled, please give this a suitable home.  			LLViewerAssetStatsFF::record_fps_main(gFPSClamped); +			LLViewerAssetStatsFF::record_avatar_stats();  		}  	} diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index e621cf647e..4928f93a51 100644..100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -30,6 +30,7 @@  #include "llregionhandle.h"  #include "stdtypes.h" +#include "llvoavatar.h"  /*   * Classes and utility functions for per-thread and per-region @@ -126,6 +127,8 @@ LLViewerAssetStats::PerRegionStats::merge(const LLViewerAssetStats::PerRegionSta  		mFPS.merge(src.mFPS);  	} +	// Avatar stats - data all comes from main thread, so leave alone. +  	// Requests  	for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i)  	{ @@ -133,6 +136,7 @@ LLViewerAssetStats::PerRegionStats::merge(const LLViewerAssetStats::PerRegionSta  		mRequests[i].mDequeued.merge(src.mRequests[i].mDequeued);  		mRequests[i].mResponse.merge(src.mRequests[i].mResponse);  	} +  } @@ -252,6 +256,14 @@ LLViewerAssetStats::recordFPS(F32 fps)  	mCurRegionStats->mFPS.record(fps);  } +void +LLViewerAssetStats::recordAvatarStats() +{ +	std::vector<S32> rez_counts; +	LLVOAvatar::getNearbyRezzedStats(rez_counts); +	mCurRegionStats->mAvatarRezStates = rez_counts; +} +  LLSD  LLViewerAssetStats::asLLSD(bool compact_output)  { @@ -282,6 +294,10 @@ LLViewerAssetStats::asLLSD(bool compact_output)  	static const LLSD::String max_tag("max");  	static const LLSD::String mean_tag("mean"); +	// Avatar sub-tags +	static const LLSD::String avatar_tag("avatar"); +	static const LLSD::String avatar_nearby_tag("nearby"); +	  	const duration_t now = LLViewerAssetStatsFF::get_timestamp();  	mCurRegionStats->accumulateTime(now); @@ -329,6 +345,11 @@ 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 j = 0; j < stats.mAvatarRezStates.size(); ++j) +		{ +			reg_stat[avatar_tag][avatar_nearby_tag].append(stats.mAvatarRezStates[j]); +		}  		U32 grid_x(0), grid_y(0);  		grid_from_region_handle(it->first, &grid_x, &grid_y); @@ -439,6 +460,14 @@ record_fps_main(F32 fps)  	gViewerAssetStatsMain->recordFPS(fps);  } +void +record_avatar_stats() +{ +	if (! gViewerAssetStatsMain) +		return; + +	gViewerAssetStatsMain->recordAvatarStats(); +}  // 'thread1' - should be for TextureFetch thread diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 73ec5974b2..6cb0cc4060 100644..100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -125,7 +125,8 @@ public:  			  mRegionHandle(src.mRegionHandle),  			  mTotalTime(src.mTotalTime),  			  mStartTimestamp(src.mStartTimestamp), -			  mFPS(src.mFPS) +			  mFPS(src.mFPS), +			  mAvatarRezStates(src.mAvatarRezStates)  			{  				for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i)  				{ @@ -148,6 +149,7 @@ public:  		duration_t			mTotalTime;  		duration_t			mStartTimestamp;  		LLSimpleStatMMM<>	mFPS; +		std::vector<S32>	mAvatarRezStates;  		struct prs_group  		{ @@ -181,6 +183,9 @@ public:  	// Frames-Per-Second Samples  	void recordFPS(F32 fps); +	// Avatar-related statistics +	void recordAvatarStats(); +  	// Merge a source instance into a destination instance.  This is  	// conceptually an 'operator+=()' method:  	// - counts are added @@ -310,6 +315,7 @@ void record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_t  void record_fps_main(F32 fps); +void record_avatar_stats();  /**   * Region context, event and duration loggers for Thread 1. diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 33f33b202f..27de7df51c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2141,7 +2141,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics()  	LLSD msg = metricsData();  	msg["message"] = "ViewerAppearanceChangeMetrics"; -	llinfos << "message: " << msg << llendl; +	llinfos << avString() << "message: " << msg << llendl;  	std::string	caps_url;  	if (getRegion())  	{ diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 3faddc13c1..5e18f91b23 100644..100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -35,6 +35,15 @@  #include "lluuid.h"  #include "llsdutil.h"  #include "llregionhandle.h" +#include "../llvoavatar.h" + +void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts) +{ +	counts.resize(3); +	counts[0] = 0; +	counts[1] = 0; +	counts[2] = 1; +}  static const char * all_keys[] =   { | 
