abtest.CoolDown
abtest.CoolDown
#Overview
name: abtest.CoolDown
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of frames to discard data after each command to cover threading.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of abtest.CoolDown is to control the number of frames to discard data after each command in the AB testing system of Unreal Engine 5. This setting is specifically used for profiling and debugging purposes.
This setting variable is primarily used in the Core module of Unreal Engine, specifically within the ProfilingDebugging subsystem. It’s part of the AB testing functionality, which is likely used for performance comparisons and optimizations.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 5 frames, but can be changed at runtime through console commands or configuration files.
The abtest.CoolDown variable interacts directly with the CVarABTestCoolDown variable. They share the same value, with CVarABTestCoolDown being the actual TAutoConsoleVariable that stores and manages the value.
Developers must be aware that this variable affects the data collection process in AB testing. By discarding a certain number of frames after each command, it helps to account for any threading-related issues or temporary performance fluctuations that might occur immediately after a change is made.
Best practices when using this variable include:
- Adjusting the value based on the complexity of your game and the nature of the tests you’re running.
- Ensuring that the cool-down period is long enough to stabilize performance after changes, but not so long that it significantly extends testing time.
- Considering this value in conjunction with other AB testing settings like MinFramesPerTrial for a comprehensive testing strategy.
Regarding the associated variable CVarABTestCoolDown:
The purpose of CVarABTestCoolDown is to provide a programmatic interface to the abtest.CoolDown setting within the C++ code of Unreal Engine.
This variable is used directly in the FABTest::Start function, where its value is retrieved and assigned to the CoolDown member variable of the FABTest class. This suggests that the CVarABTestCoolDown is the actual variable used in the AB testing implementation, while abtest.CoolDown is the console-accessible name for this setting.
The value of CVarABTestCoolDown is set through the TAutoConsoleVariable constructor, but can be modified at runtime through console commands.
Developers should be aware that changes to CVarABTestCoolDown will directly affect the behavior of the AB testing system. It’s important to understand that this variable is part of a larger set of AB testing variables, and its effects should be considered in that context.
Best practices for using CVarABTestCoolDown include:
- Using the GetValueOnGameThread() method to retrieve its current value, as shown in the FABTest::Start function.
- Considering thread safety when accessing or modifying this variable, as it’s accessed on the game thread.
- Documenting any runtime changes to this variable, as it can significantly impact test results.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp:31
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarABTestCoolDown(
TEXT("abtest.CoolDown"),
5,
TEXT("Number of frames to discard data after each command to cover threading."));
static TAutoConsoleVariable<int32> CVarABTestMinFramesPerTrial(
TEXT("abtest.MinFramesPerTrial"),
10,
#Associated Variable and Callsites
This variable is associated with another variable named CVarABTestCoolDown
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp:30
Scope: file
Source code excerpt:
TEXT("Number of frames between reports."));
static TAutoConsoleVariable<int32> CVarABTestCoolDown(
TEXT("abtest.CoolDown"),
5,
TEXT("Number of frames to discard data after each command to cover threading."));
static TAutoConsoleVariable<int32> CVarABTestMinFramesPerTrial(
TEXT("abtest.MinFramesPerTrial"),
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp:347
Scope (from outer to inner):
file
function void FABTest::Start
Source code excerpt:
HistoryNum = CVarABTestHistory.GetValueOnGameThread();
ReportNum = CVarABTestReportNum.GetValueOnGameThread();
CoolDown = CVarABTestCoolDown.GetValueOnGameThread();
MinFramesPerTrial = CVarABTestMinFramesPerTrial.GetValueOnGameThread();
NumResamples = CVarABTestNumResamples.GetValueOnGameThread();
Samples.Empty(HistoryNum);
ResampleAccumulators.Empty(NumResamples);
ResampleAccumulators.AddZeroed(NumResamples);