コード例 #1
0
ファイル: lllandmark.cpp プロジェクト: HizWylder/GIS
// static
void LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**)
{
	LLUUID region_id;
	msg->getUUID("ReplyBlock", "RegionID", region_id);
	mRegions.erase(region_id);
	CacheInfo info;
	const F32 CACHE_EXPIRY_SECONDS = 60.0f * 10.0f; // ten minutes
	info.mTimer.setTimerExpirySec(CACHE_EXPIRY_SECONDS);
	msg->getU64("ReplyBlock", "RegionHandle", info.mRegionHandle);
	region_map_t::value_type vt(region_id, info);
	mRegions.insert(vt);

#if LL_DEBUG
	U32 grid_x, grid_y;
	grid_from_region_handle(info.mRegionHandle, &grid_x, &grid_y);
	lldebugs << "Landmark got reply for region: " << region_id << " "
			 << grid_x << "," << grid_y << llendl;
#endif

	// make all the callbacks here.
	region_callback_map_t::iterator it;
	while((it = sRegionCallbackMap.find(region_id)) != sRegionCallbackMap.end())
	{
		(*it).second(region_id, info.mRegionHandle);
		sRegionCallbackMap.erase(it);
	}
}
コード例 #2
0
ファイル: llvocache.cpp プロジェクト: kow/Astra-Viewer-2
void LLVOCache::getObjectCacheFilename(U64 handle, std::string& filename) 
{
	U32 region_x, region_y;

	grid_from_region_handle(handle, &region_x, &region_y);
	filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, object_cache_dirname,
			   llformat(OBJECT_CACHE_FILENAME, region_x, region_y));

	return ;
}
コード例 #3
0
LLSD
LLViewerAssetStats::asLLSD(bool compact_output)
{
	// Top-level tags
	static const LLSD::String tags[EVACCount] = 
		{
			LLSD::String("get_texture_temp_http"),
			LLSD::String("get_texture_temp_udp"),
			LLSD::String("get_texture_non_temp_http"),
			LLSD::String("get_texture_non_temp_udp"),
			LLSD::String("get_wearable_udp"),
			LLSD::String("get_sound_udp"),
			LLSD::String("get_gesture_udp"),
			LLSD::String("get_other")
		};

	// Stats Group Sub-tags.
	static const LLSD::String enq_tag("enqueued");
	static const LLSD::String deq_tag("dequeued");
	static const LLSD::String rcnt_tag("resp_count");
	static const LLSD::String rmin_tag("resp_min");
	static const LLSD::String rmax_tag("resp_max");
	static const LLSD::String rmean_tag("resp_mean");

	// MMM Group Sub-tags.
	static const LLSD::String cnt_tag("count");
	static const LLSD::String min_tag("min");
	static const LLSD::String max_tag("max");
	static const LLSD::String mean_tag("mean");

	const duration_t now = LLViewerAssetStatsFF::get_timestamp();
	mCurRegionStats->accumulateTime(now);

	LLSD regions = LLSD::emptyArray();
	for (PerRegionContainer::iterator it = mRegionStats.begin();
		 mRegionStats.end() != it;
		 ++it)
	{
		if (0 == it->first)
		{
			// Never emit NULL UUID/handle in results.
			continue;
		}

		PerRegionStats & stats = *it->second;
		
		LLSD reg_stat = LLSD::emptyMap();
		
		for (int i = 0; i < LL_ARRAY_SIZE(tags); ++i)
		{
			PerRegionStats::prs_group & group(stats.mRequests[i]);
			
			if ((! compact_output) ||
				group.mEnqueued.getCount() ||
				group.mDequeued.getCount() ||
				group.mResponse.getCount())
			{
				LLSD & slot = reg_stat[tags[i]];
				slot = LLSD::emptyMap();
				slot[enq_tag] = LLSD(S32(stats.mRequests[i].mEnqueued.getCount()));
				slot[deq_tag] = LLSD(S32(stats.mRequests[i].mDequeued.getCount()));
				slot[rcnt_tag] = LLSD(S32(stats.mRequests[i].mResponse.getCount()));
				slot[rmin_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMin().valueInUnits<LLUnits::Seconds>()));
				slot[rmax_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMax().valueInUnits<LLUnits::Seconds>()));
				slot[rmean_tag] = LLSD(F64(stats.mRequests[i].mResponse.getMean().valueInUnits<LLUnits::Seconds>()));
			}
		}

		if ((! compact_output) || stats.mFPS.getCount())
		{
			LLSD & slot = reg_stat["fps"];
			slot = LLSD::emptyMap();
			slot[cnt_tag] = LLSD(S32(stats.mFPS.getCount()));
			slot[min_tag] = LLSD(F64(stats.mFPS.getMin()));
			slot[max_tag] = LLSD(F64(stats.mFPS.getMax()));
			slot[mean_tag] = LLSD(F64(stats.mFPS.getMean()));
		}
		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);
		reg_stat["grid_y"] = LLSD::Integer(grid_y);
		reg_stat["duration"] = LLSD::Real(stats.mTotalTime.valueInUnits<LLUnits::Seconds>());		
		regions.append(reg_stat);
	}

	LLSD ret = LLSD::emptyMap();
	ret["regions"] = regions;
	ret["duration"] = LLSD::Real((now - mResetTimestamp).valueInUnits<LLUnits::Seconds>());
	
	return ret;
}