abtest.HistoryNum

abtest.HistoryNum

#Overview

name: abtest.HistoryNum

This variable is created as a Console Variable (cvar).

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:

  1. 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.
  2. Monitoring performance impact when increasing this value, especially on memory-constrained platforms.
  3. 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:

#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);