From 1310630ac60ba292f52761e795eaa55610818b9b Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 12 Apr 2013 20:11:17 +0000 Subject: SH-4090 [WIP] Basic deadman timer integration started on Linux. Moving to windows to do real work. --- indra/newview/llmeshrepository.cpp | 45 ++++++++++++++++++++++++++++++++++++-- indra/newview/llmeshrepository.h | 11 ++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 1223615079..11c5780a30 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -37,6 +37,7 @@ #include "llcallbacklist.h" #include "llcurl.h" #include "lldatapacker.h" +#include "lldeadmantimer.h" #include "llfloatermodelpreview.h" #include "llfloaterperms.h" #include "lleconomy.h" @@ -94,8 +95,9 @@ U32 LLMeshRepository::sLODPending = 0; U32 LLMeshRepository::sCacheBytesRead = 0; U32 LLMeshRepository::sCacheBytesWritten = 0; U32 LLMeshRepository::sPeakKbps = 0; - +LLDeadmanTimer LLMeshRepository::sQuiescentTimer(15.0); + const U32 MAX_TEXTURE_UPLOAD_RETRIES = 5; static S32 dump_num = 0; @@ -115,7 +117,6 @@ std::string header_lod[] = "high_lod" }; - //get the number of bytes resident in memory for given volume U32 get_volume_memory_size(const LLVolume* volume) { @@ -2678,6 +2679,9 @@ void LLMeshRepository::notifyDecompositionReceived(LLModel::Decomposition* decom void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume) { //called from main thread + // Manage time-to-load metrics for mesh download operations. + metricsCheck(); + S32 detail = LLVolumeLODGroup::getVolumeDetailFromScale(volume->getDetail()); //get list of objects waiting to be notified this mesh is loaded @@ -3699,3 +3703,40 @@ bool LLMeshRepository::meshRezEnabled() } return false; } + +void LLMeshRepository::metricsStart() +{ + sQuiescentTimer.start(); +} + +void LLMeshRepository::metricsStop() +{ + sQuiescentTimer.stop(); +} + +void LLMeshRepository::metricsCheck() +{ + static bool first_start(true); + F64 started, stopped; + U64 count; + + if (first_start) + { + // Let the first request start the timing cycle for login. + metricsStart(); + first_start = false; + } + sQuiescentTimer.ringBell(); + if (sQuiescentTimer.isExpired(started, stopped, count)) + { + LLSD metrics; + + metrics["reason"] = "Mesh download quiescent"; + metrics["scope"] = "Login"; + metrics["start"] = started; + metrics["stop"] = stopped; + metrics["downloads"] = LLSD::Integer(count); + llinfos << "MetricsMarker" << metrics << llendl; + } +} + diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8602271f84..f08feedf81 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -32,6 +32,7 @@ #include "lluuid.h" #include "llviewertexture.h" #include "llvolume.h" +#include "lldeadmantimer.h" #define LLCONVEXDECOMPINTER_STATIC 1 @@ -455,14 +456,15 @@ public: static U32 sCacheBytesRead; static U32 sCacheBytesWritten; static U32 sPeakKbps; - + static LLDeadmanTimer sQuiescentTimer; // time-to-complete-mesh-downloads after significant events + static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); LLMeshRepository(); void init(); void shutdown(); - S32 update() ; + S32 update(); //mesh management functions S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0, S32 last_lod = -1); @@ -495,6 +497,11 @@ public: S32 getMeshSize(const LLUUID& mesh_id, S32 lod); + // Quiescent timer management, main thread only. + static void metricsStart(); + static void metricsStop(); + static void metricsCheck(); + typedef std::map > mesh_load_map; mesh_load_map mLoadingMeshes[4]; -- cgit v1.2.3