From 5ae8b9cae1c95d797f4dbaee807650901e18b5ba Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 13 May 2023 13:45:53 +0200 Subject: [PATCH 1/2] Report raw navmesh cache counters --- components/detournavigator/stats.cpp | 11 ++++------- components/resource/stats.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/components/detournavigator/stats.cpp b/components/detournavigator/stats.cpp index bc307bc772..1d7dcac553 100644 --- a/components/detournavigator/stats.cpp +++ b/components/detournavigator/stats.cpp @@ -20,18 +20,15 @@ namespace DetourNavigator out.setAttribute( frameNumber, "NavMesh DbJobs Read", static_cast(stats.mDb->mJobs.mReadingJobs)); - if (stats.mDb->mGetTileCount > 0) - out.setAttribute(frameNumber, "NavMesh DbCacheHitRate", - static_cast(stats.mDbGetTileHits) / static_cast(stats.mDb->mGetTileCount) - * 100.0); + out.setAttribute(frameNumber, "NavMesh DbCache Get", static_cast(stats.mDb->mGetTileCount)); + out.setAttribute(frameNumber, "NavMesh DbCache Hit", static_cast(stats.mDbGetTileHits)); } out.setAttribute(frameNumber, "NavMesh CacheSize", static_cast(stats.mCache.mNavMeshCacheSize)); out.setAttribute(frameNumber, "NavMesh UsedTiles", static_cast(stats.mCache.mUsedNavMeshTiles)); out.setAttribute(frameNumber, "NavMesh CachedTiles", static_cast(stats.mCache.mCachedNavMeshTiles)); - if (stats.mCache.mGetCount > 0) - out.setAttribute(frameNumber, "NavMesh CacheHitRate", - static_cast(stats.mCache.mHitCount) / stats.mCache.mGetCount * 100.0); + out.setAttribute(frameNumber, "NavMesh Cache Get", static_cast(stats.mCache.mGetCount)); + out.setAttribute(frameNumber, "NavMesh Cache Hit", static_cast(stats.mCache.mHitCount)); } } diff --git a/components/resource/stats.cpp b/components/resource/stats.cpp index 2bddff5cfd..13f37d48da 100644 --- a/components/resource/stats.cpp +++ b/components/resource/stats.cpp @@ -448,11 +448,13 @@ namespace Resource "NavMesh Processing", "NavMesh DbJobs Write", "NavMesh DbJobs Read", - "NavMesh DbCacheHitRate", + "NavMesh DbCache Get", + "NavMesh DbCache Hit", "NavMesh CacheSize", "NavMesh UsedTiles", "NavMesh CachedTiles", - "NavMesh CacheHitRate", + "NavMesh Cache Get", + "NavMesh Cache Hit", "", "Mechanics Actors", "Mechanics Objects", From a90aa7d8b2fbd637cc42a74bb3afc46a61fdb9bb Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 13 May 2023 14:56:45 +0200 Subject: [PATCH 2/2] Count navmeshdb reads for each reading job --- components/detournavigator/asyncnavmeshupdater.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/detournavigator/asyncnavmeshupdater.cpp b/components/detournavigator/asyncnavmeshupdater.cpp index 0ba7906b6a..f30b325e60 100644 --- a/components/detournavigator/asyncnavmeshupdater.cpp +++ b/components/detournavigator/asyncnavmeshupdater.cpp @@ -823,6 +823,8 @@ namespace DetourNavigator void DbWorker::processReadingJob(JobIt job) { + ++mGetTileCount; + Log(Debug::Debug) << "Processing db read job " << job->mId; if (job->mInput.empty()) @@ -865,7 +867,6 @@ namespace DetourNavigator } job->mCachedTileData = mDb->getTileData(job->mWorldspace, job->mChangedTile, job->mInput); - ++mGetTileCount; } void DbWorker::processWritingJob(JobIt job)