diff options
| -rw-r--r-- | indra/newview/llappviewer.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llworld.cpp | 5 |
3 files changed, 16 insertions, 4 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 4a6739bb40..263c1f2054 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3621,10 +3621,11 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBVLC_VERSION"] = "Undefined"; #endif - S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); + S32 packets_in = (S32)recording.getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) { - info["PACKETS_LOST"] = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); + info["PACKETS_LOST"] = recording.getSum(LLStatViewer::PACKETS_LOST); info["PACKETS_IN"] = packets_in; info["PACKETS_PCT"] = 100.f*info["PACKETS_LOST"].asReal() / info["PACKETS_IN"].asReal(); } @@ -4380,6 +4381,13 @@ void LLAppViewer::requestQuit() // This prevents the halfway-logged-in avatar from hanging around inworld for a couple minutes. if (region) { + // We probably don't have caps to do it, and it might + // arrive after logout finishes, but attempt to send stats + if (region->capabilitiesReceived()) + { + constexpr bool include_preferences = true; + send_viewer_stats(include_preferences); + } sendLogoutRequest(); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4229ffcfb5..ce8aed8d6f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1549,6 +1549,9 @@ bool LLViewerWindow::handleSessionExit(LLWindow* window) { // Viewer received WM_ENDSESSION and app will be killed soon if it doesn't respond LLAppViewer* app = LLAppViewer::instance(); + // Normally we'd include preferences, but serializing them can be expensive. + // There is also a chance this won't be processed if the logout request arrives first. + app->sendViewerStatistics(false /*no preferences*/); app->sendSimpleLogoutRequest(); app->earlyExitNoNotify(); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index cad36828d1..b09c2d00bb 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -806,10 +806,11 @@ void LLWorld::updateNetStats() add(LLStatViewer::PACKETS_OUT, packets_out); add(LLStatViewer::PACKETS_LOST, packets_lost); - F32 total_packets_in = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); + F32 total_packets_in = (F32)recording.getSum(LLStatViewer::PACKETS_IN); if (total_packets_in > 0.f) { - F32 total_packets_lost = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); + F32 total_packets_lost = (F32)recording.getSum(LLStatViewer::PACKETS_LOST); sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)total_packets_lost/(F32)total_packets_in)); } |
