summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2026-05-26 22:41:24 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2026-05-27 14:53:12 +0300
commitf269701ed77d9f863053e9d4534337444c5a4b37 (patch)
treea03771d2b9eedc7316d9e11555df07f19383991d /indra
parentf27285d02b0f9ef4ba18d37b2d1c743bcfe4fdec (diff)
#5368 add the timer for doFrame
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llappviewer.cpp5
-rw-r--r--indra/newview/llstatslistener.cpp3
-rw-r--r--indra/newview/llviewerstats.cpp2
-rw-r--r--indra/newview/llviewerstats.h2
4 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 59056381e1..0b46e2ccc3 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -150,6 +150,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <boost/throw_exception.hpp>
+#include <chrono>
#if LL_WINDOWS
# include <share.h> // For _SH_DENYWR in processMarkerFiles
@@ -1288,7 +1289,11 @@ bool LLAppViewer::frame()
{
try
{
+ const auto start = std::chrono::steady_clock::now();
ret = doFrame();
+ const auto end = std::chrono::steady_clock::now();
+ const U64 doframe_time_us = (U64)std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
+ LLTrace::sample(LLStatViewer::DOFRAME_TIME_US, doframe_time_us);
}
catch (const LLContinueError&)
{
diff --git a/indra/newview/llstatslistener.cpp b/indra/newview/llstatslistener.cpp
index 47b025cd8b..b0f8d54231 100644
--- a/indra/newview/llstatslistener.cpp
+++ b/indra/newview/llstatslistener.cpp
@@ -101,6 +101,9 @@ void LLStatsListener::getPerfData(LLSD const & evt)
setPeriodArray(frametime, "frame_time_ms", last, recording, num_periods, LLStatViewer::FRAMETIME,
[](LLTrace::Recording& period, const auto& stat) { return period.getMean(stat); });
+ setPeriodArray(frametime, "do_frame_time_us", last, recording, num_periods, LLStatViewer::DOFRAME_TIME_US,
+ [](LLTrace::Recording& period, const auto& stat) { return period.getMean(stat); });
+
setPeriodArray(frametime, "frame_time_jitter_ms", last, recording, num_periods, LLStatViewer::FRAMETIME_JITTER,
[](LLTrace::Recording& period, const auto& stat) { return period.getMean(stat); });
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 6490fe76a2..aa9ec9c56f 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -232,6 +232,8 @@ LLTrace::SampleStatHandle<U32> FRAMETIME_JITTER_EVENTS("frametimeevents", "Numbe
FRAMETIME_JITTER_EVENTS_PER_MINUTE("frametimeeventspm", "Average number of frametime events per minute."),
FRAMETIME_JITTER_EVENTS_LAST_MINUTE("frametimeeventslastmin", "Number of frametime events in the last minute.");
+LLTrace::SampleStatHandle<U64> DOFRAME_TIME_US("doframetimeus", "doFrame wall time in microseconds.");
+
LLTrace::SampleStatHandle<F64> NOTRMALIZED_FRAMETIME_JITTER_SESSION("normalizedframetimejitter", "Normalized frametime jitter over the session.");
LLTrace::SampleStatHandle<F64> NFTV("nftv", "Normalized frametime variation.");
LLTrace::SampleStatHandle<F64> NORMALIZED_FRAMTIME_JITTER_PERIOD("normalizedframetimejitterperiod", "Normalized frametime jitter over the last 5 seconds.");
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index f670dadc27..7da74e716b 100644
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -223,6 +223,8 @@ extern LLTrace::SampleStatHandle<U32> FRAMETIME_JITTER_EVENTS,
FRAMETIME_JITTER_EVENTS_PER_MINUTE,
FRAMETIME_JITTER_EVENTS_LAST_MINUTE;
+extern LLTrace::SampleStatHandle<U64> DOFRAME_TIME_US;
+
extern LLTrace::SampleStatHandle<F64> NOTRMALIZED_FRAMETIME_JITTER_SESSION;
extern LLTrace::SampleStatHandle<F64> NFTV;
extern LLTrace::SampleStatHandle<F64> NORMALIZED_FRAMTIME_JITTER_PERIOD;