diff options
author | nat-goodspeed <nat@lindenlab.com> | 2024-10-21 11:42:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-21 11:42:06 -0400 |
commit | 98380ef4265ca5590125ea505e3b8d41de24c049 (patch) | |
tree | d56e88e4321de8c439b1cc8d7b19ac24fcac0b7a /indra/newview | |
parent | 99937bf3d4c68fa32cdc888b8cd9b9ed9d43fdbf (diff) | |
parent | 413a8ada3661180c06403e06b98685a1f7139a7a (diff) |
Merge pull request #2882 from secondlife/nat/frame-profile-stats
Add the latest viewer stats packet into Frame Profile dump file.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerstats.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewerstats.h | 1 |
3 files changed, 18 insertions, 6 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 1f4502323c..cb741e4af9 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -79,6 +79,7 @@ #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewershadermgr.h" +#include "llviewerstats.h" #include "llviewertexturelist.h" #include "llviewerwindow.h" #include "llvoavatarself.h" @@ -1085,6 +1086,9 @@ void getProfileStatsContext(boost::json::object& stats) context.emplace("parcelid", parcel->getLocalID()); } context.emplace("time", LLDate::now().toHTTPDateString("%Y-%m-%dT%H:%M:%S")); + + // supplement with stats packet + stats.emplace("stats", LlsdToJson(capture_viewer_stats(true))); } std::string getProfileStatsFilename() diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 9d4c072909..a4b06b1e1a 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -67,6 +67,7 @@ #include "lluiusage.h" #include "lltranslate.h" #include "llluamanager.h" +#include "scope_exit.h" // "Minimal Vulkan" to get max API Version @@ -510,7 +511,6 @@ void send_viewer_stats(bool include_preferences) return; } - LLSD body; std::string url = gAgent.getRegion()->getCapability("ViewerStats"); if (url.empty()) { @@ -518,8 +518,18 @@ void send_viewer_stats(bool include_preferences) return; } - LLViewerStats::instance().getRecording().pause(); + LLSD body = capture_viewer_stats(include_preferences); + LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body, + "Statistics posted to sim", "Failed to post statistics to sim"); +} + +LLSD capture_viewer_stats(bool include_preferences) +{ + LLViewerStats& vstats{ LLViewerStats::instance() }; + vstats.getRecording().pause(); + LL::scope_exit cleanup([&vstats]{ vstats.getRecording().resume(); }); + LLSD body; LLSD &agent = body["agent"]; time_t ltime; @@ -791,10 +801,7 @@ void send_viewer_stats(bool include_preferences) body["session_id"] = gAgentSessionID; LLViewerStats::getInstance()->addToMessage(body); - - LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body, - "Statistics posted to sim", "Failed to post statistics to sim"); - LLViewerStats::instance().getRecording().resume(); + return body; } LLTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name) diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 8aed1c537e..dd66fee436 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -281,6 +281,7 @@ static const F32 SEND_STATS_PERIOD = 300.0f; // The following are from (older?) statistics code found in appviewer. void update_statistics(); +LLSD capture_viewer_stats(bool include_preferences); void send_viewer_stats(bool include_preferences); void update_texture_time(); |