Navigation
API > API/Runtime > API/Runtime/CoreUObject
Asset Read Logger - tracks unique asset reads during runtime
Logs each unique package load to CSV for profiling and optimization analysis. Tracks container type (Pak, IAD, IAS, IoStore, Loose), chunk ID, size, and which thread initiated the load.
Usage: -LogAssetReads Output to Saved/Profiling/AssetReads_
Console command: AssetReadLogger.SweepAndFlush Sweep for missed packages and flush CSV to disk
CSV columns: AssetPath, MountPoint, ContainerType, ChunkID, ContainerName, SizeBytes, LoadTimestamp, Thread
| Name | FAssetReadLogger |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/Misc/AssetReadLogger.h |
| Include Path | #include "Misc/AssetReadLogger.h" |
Syntax
class FAssetReadLogger
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Misc/AssetReadLogger.h | |||
FAssetReadLogger
(
const FAssetReadLogger& |
Misc/AssetReadLogger.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FAssetReadLogger() |
Misc/AssetReadLogger.h |
Structs
| Name | Remarks |
|---|---|
| FCachedContainerInfo | Built from pak mount events for container detection. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AssetReadLock | FRWLock | Misc/AssetReadLogger.h | ||
| AsyncLoadPackageDelegateHandle | FDelegateHandle | Misc/AssetReadLogger.h | ||
| AsyncLoadRequestLock | FCriticalSection | Misc/AssetReadLogger.h | ||
| AsyncLoadRequestThreads | TMap< FString, FString > | Maps package name -> requesting thread (for accurate async load attribution) | Misc/AssetReadLogger.h | |
| bIsEnabled | std::atomic< bool > | Misc/AssetReadLogger.h | ||
| ContainerFlagsCache | TMap< FString, uint8 > | Misc/AssetReadLogger.h | ||
| ContainerFlagsCacheLock | FRWLock | Misc/AssetReadLogger.h | ||
| EngineInitCompleteDelegateHandle | FDelegateHandle | Misc/AssetReadLogger.h | ||
| OutputFileArchive | TUniquePtr< FArchive > | Misc/AssetReadLogger.h | ||
| OutputFileLock | FCriticalSection | Misc/AssetReadLogger.h | ||
| OutputFilePath | FString | Misc/AssetReadLogger.h | ||
| PackageContainerCacheLock | FRWLock | Misc/AssetReadLogger.h | ||
| PackageLoadedDelegateHandle | FDelegateHandle | Misc/AssetReadLogger.h | ||
| PackageToContainerCache | TMap< FString, FCachedContainerInfo > | Misc/AssetReadLogger.h | ||
| PakFileMountedDelegateHandle | FDelegateHandle | Misc/AssetReadLogger.h | ||
| PendingSyncLoadLock | FCriticalSection | Misc/AssetReadLogger.h | ||
| PendingSyncLoadPackages | TSet< FString > | Tracks sync loads that may not trigger OnPackageLoadCompleted immediately. | Misc/AssetReadLogger.h | |
| StartTime | double | Misc/AssetReadLogger.h | ||
| StatsByContainerType | TMap< EAssetContainerType, FAssetContainerStats > | Misc/AssetReadLogger.h | ||
| SyncLoadPackageDelegateHandle | FDelegateHandle | Misc/AssetReadLogger.h | ||
| TotalReadsAttempted | std::atomic< int64 > | Misc/AssetReadLogger.h | ||
| UniqueAssetReads | TSet< FAssetReadInfo > | Misc/AssetReadLogger.h | ||
| UniqueReadsLogged | std::atomic< int64 > | Misc/AssetReadLogger.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AppendCSVMetadataStats () |
Computes aggregate stats from the in-memory tracked asset reads and pushes them to CsvProfiler SetMetadata under `assetreads_*_. | Misc/AssetReadLogger.h | |
int64 GetTotalReadAttempts() |
Misc/AssetReadLogger.h | ||
int64 GetUniqueAssetCount() |
Misc/AssetReadLogger.h | ||
bool Initialize() |
Returns true if logging was enabled via command line | Misc/AssetReadLogger.h | |
bool IsEnabled() |
Misc/AssetReadLogger.h | ||
void LogAssetRead
(
const FString& AssetPath, |
Misc/AssetReadLogger.h | ||
void Shutdown() |
Writes final CSV and unregisters hooks | Misc/AssetReadLogger.h | |
void SweepAndFlushToFile() |
Sweep + flush without stopping the logger | Misc/AssetReadLogger.h | |
void SweepForMissedPackages() |
Must be called from GameThread | Misc/AssetReadLogger.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Misc/AssetReadLogger.h | |||
static FAssetReadLogger & Get() |
Misc/AssetReadLogger.h | ||
static FString GetCurrentThreadName() |
Misc/AssetReadLogger.h | ||
static bool IsTrackableAssetPath
(
const FString& AssetPath |
Filters out /Temp/, /Memory/, /Script/, transient packages | Misc/AssetReadLogger.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAssetReadLogger & operator=
(
const FAssetReadLogger& |
Misc/AssetReadLogger.h |