From f27285d02b0f9ef4ba18d37b2d1c743bcfe4fdec Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 26 May 2026 18:34:37 +0300 Subject: #5368 add Leap API to query statistics --- indra/newview/llinventorymodelbackgroundfetch.cpp | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp') diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 82eefb50ac..f68eb7f4a5 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -192,6 +192,8 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): mFetchCount(0), mLastFetchCount(0), mFetchFolderCount(0), + mInitialFetchDuration(0.f), + mInitialFetchDurationCaptured(false), mAllRecursiveFoldersFetched(false), mRecursiveInventoryFetchStarted(false), mRecursiveLibraryFetchStarted(false), @@ -199,6 +201,14 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): mMinTimeBetweenFetches(0.3f) {} +void LLInventoryModelBackgroundFetch::markFetchStarted() +{ + if (!mBackgroundFetchActive) + { + mFetchStartTimer.reset(); + } +} + LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() { gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); @@ -289,6 +299,7 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive) // it's a folder, do a bulk fetch LL_DEBUGS(LOG_INV) << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL; + markFetchStarted(); mBackgroundFetchActive = true; mFolderFetchActive = true; EFetchType recursion_type = recursive ? FT_RECURSIVE : FT_DEFAULT; @@ -376,6 +387,7 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id, { if (mFetchFolderQueue.empty() || mFetchFolderQueue.front().mUUID != cat_id) { + markFetchStarted(); mBackgroundFetchActive = true; mFolderFetchActive = true; @@ -403,6 +415,7 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b { if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id) { + markFetchStarted(); mBackgroundFetchActive = true; if (forced) { @@ -447,6 +460,7 @@ void LLInventoryModelBackgroundFetch::fetchFolderAndLinks(const LLUUID& cat_id, }); // start idle loop to track completion + markFetchStarted(); mBackgroundFetchActive = true; mFolderFetchActive = true; gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); @@ -489,6 +503,7 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback) }); // start idle loop to track completion + markFetchStarted(); mBackgroundFetchActive = true; mFolderFetchActive = true; gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); @@ -496,6 +511,7 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback) void LLInventoryModelBackgroundFetch::findLostItems() { + markFetchStarted(); mBackgroundFetchActive = true; mFolderFetchActive = true; mFetchFolderQueue.emplace_back(LLUUID::null, FT_RECURSIVE); @@ -515,6 +531,11 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() mFolderFetchActive = false; if (isBulkFetchProcessingComplete()) { + if (mAllRecursiveFoldersFetched && !mInitialFetchDurationCaptured) + { + mInitialFetchDuration = mFetchStartTimer.getElapsedTimeF32(); + mInitialFetchDurationCaptured = true; + } mBackgroundFetchActive = false; } @@ -843,6 +864,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() if (isBulkFetchProcessingComplete()) { + if (mAllRecursiveFoldersFetched && !mInitialFetchDurationCaptured) + { + mInitialFetchDuration = mFetchStartTimer.getElapsedTimeF32(); + mInitialFetchDurationCaptured = true; + } mBackgroundFetchActive = false; } } -- cgit v1.3 From ae2f146167a2599dbaca1ef70aafef078c1c3849 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 27 May 2026 17:39:30 +0300 Subject: #5368 adding simple logging and clean up --- indra/newview/CMakeLists.txt | 4 ++-- indra/newview/llinventorymodelbackgroundfetch.cpp | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e4db686776..88367540e9 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -588,6 +588,7 @@ set(viewer_SOURCE_FILES llslurl.cpp llsnapshotlivepreview.cpp llspatialpartition.cpp + llstatslistener.cpp llspeakers.cpp llspeakingindicatormanager.cpp llsplitbutton.cpp @@ -739,7 +740,6 @@ set(viewer_SOURCE_FILES llwebprofile.cpp llwind.cpp llwindowlistener.cpp - llstatslistener.cpp llwlhandlers.cpp llworld.cpp llworldmap.cpp @@ -1260,6 +1260,7 @@ set(viewer_HEADER_FILES llsnapshotlivepreview.h llsnapshotmodel.h llspatialpartition.h + llstatslistener.h llspeakers.h llspeakingindicatormanager.h llsplitbutton.h @@ -1413,7 +1414,6 @@ set(viewer_HEADER_FILES llwebprofile.h llwind.h llwindowlistener.h - llstatslistener.h llwlhandlers.h llworld.h llworldmap.h diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index f68eb7f4a5..b02b2e2eb9 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -207,6 +207,7 @@ void LLInventoryModelBackgroundFetch::markFetchStarted() { mFetchStartTimer.reset(); } + mBackgroundFetchActive = true; } LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() @@ -300,7 +301,6 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive) LL_DEBUGS(LOG_INV) << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL; markFetchStarted(); - mBackgroundFetchActive = true; mFolderFetchActive = true; EFetchType recursion_type = recursive ? FT_RECURSIVE : FT_DEFAULT; if (id.isNull()) @@ -388,7 +388,6 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id, if (mFetchFolderQueue.empty() || mFetchFolderQueue.front().mUUID != cat_id) { markFetchStarted(); - mBackgroundFetchActive = true; mFolderFetchActive = true; if (forced) @@ -416,7 +415,6 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id) { markFetchStarted(); - mBackgroundFetchActive = true; if (forced) { // check if already requested @@ -461,7 +459,6 @@ void LLInventoryModelBackgroundFetch::fetchFolderAndLinks(const LLUUID& cat_id, // start idle loop to track completion markFetchStarted(); - mBackgroundFetchActive = true; mFolderFetchActive = true; gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } @@ -504,7 +501,6 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback) // start idle loop to track completion markFetchStarted(); - mBackgroundFetchActive = true; mFolderFetchActive = true; gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); } @@ -512,7 +508,6 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback) void LLInventoryModelBackgroundFetch::findLostItems() { markFetchStarted(); - mBackgroundFetchActive = true; mFolderFetchActive = true; mFetchFolderQueue.emplace_back(LLUUID::null, FT_RECURSIVE); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, nullptr); @@ -542,7 +537,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() // For now only informs about initial fetch being done mFoldersFetchedSignal(); - LL_INFOS(LOG_INV) << "Inventory background fetch completed" << LL_ENDL; + LL_INFOS(LOG_INV) << "Inventory background fetch completed after: " << mFetchStartTimer.getElapsedTimeF32() << LL_ENDL; } boost::signals2::connection LLInventoryModelBackgroundFetch::setFetchCompletionCallback(folders_fetched_callback_t cb) -- cgit v1.3