FDDCResourceUsageStats

Stats for a resource class that uses the DDC to load the resouce.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/ProfilingDebugging/CookStats.h

Include

#include "ProfilingDebugging/CookStats.h"

Syntax

struct FDDCResourceUsageStats

Remarks

Stats for a resource class that uses the DDC to load the resouce. This supports timing a call for synchronous work and asynchronous waits.

SyncWork timing should be any code that is explicitly synchronous, be it a DDC fetch or building the DDC resource. For SyncWork, a "hit" means we fetched from the DDC, and a "miss" means we had to build the resource. Either way, the bytes processed should be set appropriately via calls to AddHitOrMiss().

AsyncWait timing should be any code that is waiting on any explicitly asynchronous work to complete. This should only time the wait portion. A "hit" or "miss" should be interpreted the same way as in SyncWork. The Cycles counter should be measuring WAIT time, NOT the time the async task took to complete.

Many systems build assets in a very different spot in the code than they are retrieved. When that happens TrackCyclesOnly() should be called on the timer, and the Miss should be timed where the resource is actually built so the size can cycles used to build the resource can be tracked properly. In such cases, the time to TRY to get from the DDC will be timed along with the actual time to build the resource But there will only be a single CallCount recorded. This is desired so that every Miss() counted will properly equate to one resource built. Look for calls to TrackCyclesOnly() to see how this works in practice.

Async tasks can sometimes actually be executed synchronously if the code ends up waiting on the results before the task can even get started. Either way, this should be treated as "async" wait time. Be sure not to double count this time. Basically, do your counting at the level that decides whether to execute the work synchronously or not, so you can be sure to track the time properly as SyncWork or AsyncWait.

Variables

Name Description

Public variable

FCookStats::Cal...

 

AsyncWaitStats

Public variable

FCookStats::Cal...

 

SyncWorkStats

Expose these publicly for low level access. These should really never be accessed directly except when finished accumulating them.

Functions

Name Description

Public function Const

void

 

LogStats

(
    FCookStatsManager::AddStatFuncRef A...,
    const FString& StatName,
    const FString& NodeName
)

Public function

FCookStats::...

 

TimeAsyncWait()

Call this where the code is waiting on async work to build the resource

Public function

FCookStats::...

 

TimeSyncWork()

Call this where the code is building the resource synchronously

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss