|
|
|
|
@ -46,10 +46,8 @@ static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_
|
|
|
|
|
static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures");
|
|
|
|
|
|
|
|
|
|
LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) :
|
|
|
|
|
mLogTextureDownloadsToViewerLog(false),
|
|
|
|
|
mLogTextureDownloadsToSimulator(false),
|
|
|
|
|
mTextureDownloadProtocol("NONE"),
|
|
|
|
|
mTextureLogThreshold(LLUnits::Kilobytes::fromValue(100))
|
|
|
|
|
mLoggingEnabled(false),
|
|
|
|
|
mTextureDownloadProtocol("NONE")
|
|
|
|
|
{
|
|
|
|
|
if (!postponeStartRecoreder)
|
|
|
|
|
{
|
|
|
|
|
@ -57,11 +55,9 @@ LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) :
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold)
|
|
|
|
|
void LLTextureInfo::setLogging(bool log_info)
|
|
|
|
|
{
|
|
|
|
|
mLogTextureDownloadsToViewerLog = writeToViewerLog;
|
|
|
|
|
mLogTextureDownloadsToSimulator = sendToSim;
|
|
|
|
|
mTextureLogThreshold = U32Bytes(textureLogThreshold);
|
|
|
|
|
mLoggingEnabled = log_info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LLTextureInfo::~LLTextureInfo()
|
|
|
|
|
@ -156,73 +152,80 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mLogTextureDownloadsToViewerLog)
|
|
|
|
|
if (mLoggingEnabled)
|
|
|
|
|
{
|
|
|
|
|
LL_INFOS() << "texture=" << id
|
|
|
|
|
<< " start=" << details.mStartTime
|
|
|
|
|
<< " end=" << details.mCompleteTime
|
|
|
|
|
<< " size=" << details.mSize
|
|
|
|
|
<< " offset=" << details.mOffset
|
|
|
|
|
<< " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime)
|
|
|
|
|
<< " protocol=" << protocol
|
|
|
|
|
<< LL_ENDL;
|
|
|
|
|
}
|
|
|
|
|
static LLCachedControl<bool> log_to_viewer_log(gSavedSettings, "LogTextureDownloadsToViewerLog", false);
|
|
|
|
|
static LLCachedControl<bool> log_to_simulator(gSavedSettings, "LogTextureDownloadsToSimulator", false);
|
|
|
|
|
static LLCachedControl<U32> texture_log_threshold(gSavedSettings, "TextureLoggingThreshold", 1);
|
|
|
|
|
|
|
|
|
|
if(mLogTextureDownloadsToSimulator)
|
|
|
|
|
{
|
|
|
|
|
add(sTextureDataDownloaded, details.mSize);
|
|
|
|
|
add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime);
|
|
|
|
|
add(sTextureDownloadsCompleted, 1);
|
|
|
|
|
mTextureDownloadProtocol = protocol;
|
|
|
|
|
if (mRecording.getSum(sTextureDataDownloaded) >= mTextureLogThreshold)
|
|
|
|
|
if (log_to_viewer_log)
|
|
|
|
|
{
|
|
|
|
|
LLSD texture_data;
|
|
|
|
|
std::stringstream startTime;
|
|
|
|
|
startTime << mCurrentStatsBundleStartTime;
|
|
|
|
|
texture_data["start_time"] = startTime.str();
|
|
|
|
|
std::stringstream endTime;
|
|
|
|
|
endTime << completeTime;
|
|
|
|
|
texture_data["end_time"] = endTime.str();
|
|
|
|
|
texture_data["averages"] = getAverages();
|
|
|
|
|
LL_INFOS() << "texture=" << id
|
|
|
|
|
<< " start=" << details.mStartTime
|
|
|
|
|
<< " end=" << details.mCompleteTime
|
|
|
|
|
<< " size=" << details.mSize
|
|
|
|
|
<< " offset=" << details.mOffset
|
|
|
|
|
<< " length=" << U32Milliseconds(details.mCompleteTime - details.mStartTime)
|
|
|
|
|
<< " protocol=" << protocol
|
|
|
|
|
<< LL_ENDL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Texture cache
|
|
|
|
|
LLSD texture_cache;
|
|
|
|
|
U32 cache_read = 0, cache_write = 0, res_wait = 0;
|
|
|
|
|
F64 cache_hit_rate = 0;
|
|
|
|
|
LLAppViewer::getTextureFetch()->getStateStats(&cache_read, &cache_write, &res_wait);
|
|
|
|
|
if (cache_read > 0 || cache_write > 0)
|
|
|
|
|
if(log_to_simulator)
|
|
|
|
|
{
|
|
|
|
|
add(sTextureDataDownloaded, details.mSize);
|
|
|
|
|
add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime);
|
|
|
|
|
add(sTextureDownloadsCompleted, 1);
|
|
|
|
|
mTextureDownloadProtocol = protocol;
|
|
|
|
|
if (mRecording.getSum(sTextureDataDownloaded) >= U32Bytes(texture_log_threshold))
|
|
|
|
|
{
|
|
|
|
|
cache_hit_rate = cache_read / (cache_read + cache_write);
|
|
|
|
|
}
|
|
|
|
|
texture_cache["cache_read"] = LLSD::Integer(cache_read);
|
|
|
|
|
texture_cache["cache_write"] = LLSD::Integer(cache_write);
|
|
|
|
|
texture_cache["hit_rate"] = LLSD::Real(cache_hit_rate);
|
|
|
|
|
texture_cache["entries"] = LLSD::Integer(LLAppViewer::getTextureCache()->getEntries());
|
|
|
|
|
texture_cache["space_max"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getMaxUsage().value()); // bytes
|
|
|
|
|
texture_cache["space_used"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getUsage().value()); // bytes
|
|
|
|
|
texture_data["texture_cache"] = texture_cache;
|
|
|
|
|
LLSD texture_data;
|
|
|
|
|
std::stringstream startTime;
|
|
|
|
|
startTime << mCurrentStatsBundleStartTime;
|
|
|
|
|
texture_data["start_time"] = startTime.str();
|
|
|
|
|
std::stringstream endTime;
|
|
|
|
|
endTime << completeTime;
|
|
|
|
|
texture_data["end_time"] = endTime.str();
|
|
|
|
|
texture_data["averages"] = getAverages();
|
|
|
|
|
|
|
|
|
|
// VO and mesh cache
|
|
|
|
|
LLSD object_cache;
|
|
|
|
|
object_cache["vo_entries_max"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntriesMax());
|
|
|
|
|
object_cache["vo_entries_curent"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntries());
|
|
|
|
|
object_cache["vo_active_entries"] = LLSD::Integer(LLWorld::getInstance()->getNumOfActiveCachedObjects());
|
|
|
|
|
U64 region_hit_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheHitCount() : 0;
|
|
|
|
|
U64 region_miss_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheMissCount() : 0;
|
|
|
|
|
F64 region_vocache_hit_rate = 0;
|
|
|
|
|
if (region_hit_count > 0 || region_miss_count > 0)
|
|
|
|
|
{
|
|
|
|
|
region_vocache_hit_rate = region_hit_count / (region_hit_count + region_miss_count);
|
|
|
|
|
}
|
|
|
|
|
object_cache["vo_region_hitcount"] = ll_sd_from_U64(region_hit_count);
|
|
|
|
|
object_cache["vo_region_misscount"] = ll_sd_from_U64(region_miss_count);
|
|
|
|
|
object_cache["vo_region_hitrate"] = LLSD::Real(region_vocache_hit_rate);
|
|
|
|
|
object_cache["mesh_reads"] = LLSD::Integer(LLMeshRepository::sCacheReads);
|
|
|
|
|
object_cache["mesh_writes"] = LLSD::Integer(LLMeshRepository::sCacheWrites);
|
|
|
|
|
texture_data["object_cache"] = object_cache;
|
|
|
|
|
// Texture cache
|
|
|
|
|
LLSD texture_cache;
|
|
|
|
|
U32 cache_read = 0, cache_write = 0, res_wait = 0;
|
|
|
|
|
F64 cache_hit_rate = 0;
|
|
|
|
|
LLAppViewer::getTextureFetch()->getStateStats(&cache_read, &cache_write, &res_wait);
|
|
|
|
|
if (cache_read > 0 || cache_write > 0)
|
|
|
|
|
{
|
|
|
|
|
cache_hit_rate = cache_read / (cache_read + cache_write);
|
|
|
|
|
}
|
|
|
|
|
texture_cache["cache_read"] = LLSD::Integer(cache_read);
|
|
|
|
|
texture_cache["cache_write"] = LLSD::Integer(cache_write);
|
|
|
|
|
texture_cache["hit_rate"] = LLSD::Real(cache_hit_rate);
|
|
|
|
|
texture_cache["entries"] = LLSD::Integer(LLAppViewer::getTextureCache()->getEntries());
|
|
|
|
|
texture_cache["space_max"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getMaxUsage().value()); // bytes
|
|
|
|
|
texture_cache["space_used"] = ll_sd_from_U64((U64)LLAppViewer::getTextureCache()->getUsage().value()); // bytes
|
|
|
|
|
texture_data["texture_cache"] = texture_cache;
|
|
|
|
|
|
|
|
|
|
send_texture_stats_to_sim(texture_data);
|
|
|
|
|
resetTextureStatistics();
|
|
|
|
|
// VO and mesh cache
|
|
|
|
|
LLSD object_cache;
|
|
|
|
|
object_cache["vo_entries_max"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntriesMax());
|
|
|
|
|
object_cache["vo_entries_curent"] = LLSD::Integer(LLVOCache::getInstance()->getCacheEntries());
|
|
|
|
|
object_cache["vo_active_entries"] = LLSD::Integer(LLWorld::getInstance()->getNumOfActiveCachedObjects());
|
|
|
|
|
U64 region_hit_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheHitCount() : 0;
|
|
|
|
|
U64 region_miss_count = gAgent.getRegion() != NULL ? gAgent.getRegion()->getRegionCacheMissCount() : 0;
|
|
|
|
|
F64 region_vocache_hit_rate = 0;
|
|
|
|
|
if (region_hit_count > 0 || region_miss_count > 0)
|
|
|
|
|
{
|
|
|
|
|
region_vocache_hit_rate = region_hit_count / (region_hit_count + region_miss_count);
|
|
|
|
|
}
|
|
|
|
|
object_cache["vo_region_hitcount"] = ll_sd_from_U64(region_hit_count);
|
|
|
|
|
object_cache["vo_region_misscount"] = ll_sd_from_U64(region_miss_count);
|
|
|
|
|
object_cache["vo_region_hitrate"] = LLSD::Real(region_vocache_hit_rate);
|
|
|
|
|
object_cache["mesh_reads"] = LLSD::Integer(LLMeshRepository::sCacheReads);
|
|
|
|
|
object_cache["mesh_writes"] = LLSD::Integer(LLMeshRepository::sCacheWrites);
|
|
|
|
|
texture_data["object_cache"] = object_cache;
|
|
|
|
|
|
|
|
|
|
send_texture_stats_to_sim(texture_data);
|
|
|
|
|
resetTextureStatistics();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|