abtest.HistoryNum
abtest.HistoryNum
#Overview
name: abtest.HistoryNum
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Number of history frames to use for stats.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of abtest.HistoryNum is to control the number of history frames used for statistics in Unreal Engine’s A/B testing system. This setting is part of the profiling and debugging subsystem, specifically related to A/B testing functionality.
The Unreal Engine subsystem that relies on this setting variable is the Core module, particularly the A/B testing component within the profiling and debugging system. This can be seen from the file path where the variable is defined: Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1000, but can be changed at runtime through console commands or configuration files.
The associated variable CVarABTestHistory interacts directly with abtest.HistoryNum. It’s a TAutoConsoleVariable that wraps the console variable, providing a programmatic interface to access and modify the value.
Developers must be aware that this variable affects the memory usage and performance of the A/B testing system. A larger history size will provide more data for statistical analysis but will consume more memory and potentially impact performance.
Best practices when using this variable include:
- Adjusting the value based on the specific needs of your A/B test. Longer tests may benefit from more history, while shorter tests might not need as much.
- Monitoring performance impact when increasing this value, especially on memory-constrained platforms.
- Considering the relationship between this value and other A/B testing settings like abtest.ReportNum for balanced and effective testing.
Regarding the associated variable CVarABTestHistory:
- Its purpose is to provide a programmatic interface to the abtest.HistoryNum console variable within the C++ code.
- It’s used in the Core module’s A/B testing system, specifically in the FABTest class.
- The value is typically accessed using the GetValueOnGameThread() method, as seen in the FABTest::Start function.
- It directly controls the size of the Samples array in the A/B testing system.
- Developers should be aware that changes to this variable will take effect the next time an A/B test is started.
- Best practices include using this variable to dynamically adjust the history size based on runtime conditions or user settings, if necessary.
#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:21
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarABTestHistory(
TEXT("abtest.HistoryNum"),
1000,
TEXT("Number of history frames to use for stats."));
static TAutoConsoleVariable<int32> CVarABTestReportNum(
TEXT("abtest.ReportNum"),
100,
#Associated Variable and Callsites
This variable is associated with another variable named CVarABTestHistory
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp:20
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarABTestHistory(
TEXT("abtest.HistoryNum"),
1000,
TEXT("Number of history frames to use for stats."));
static TAutoConsoleVariable<int32> CVarABTestReportNum(
TEXT("abtest.ReportNum"),
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/ProfilingDebugging/ABTesting.cpp:345
Scope (from outer to inner):
file
function void FABTest::Start
Source code excerpt:
bABScopeTestActive = bScopeTest;
HistoryNum = CVarABTestHistory.GetValueOnGameThread();
ReportNum = CVarABTestReportNum.GetValueOnGameThread();
CoolDown = CVarABTestCoolDown.GetValueOnGameThread();
MinFramesPerTrial = CVarABTestMinFramesPerTrial.GetValueOnGameThread();
NumResamples = CVarABTestNumResamples.GetValueOnGameThread();
Samples.Empty(HistoryNum);