net.AddNetDriverInfoToNetAnalytics

net.AddNetDriverInfoToNetAnalytics

#Overview

name: net.AddNetDriverInfoToNetAnalytics

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 net.AddNetDriverInfoToNetAnalytics is to control whether NetDriver information is automatically added to the NetAnalytics cache. This setting is primarily used for networking and analytics systems within Unreal Engine.

This setting variable is primarily used in the Engine module, specifically within the networking subsystem. Based on the callsites, it’s clear that this variable is utilized in the NetDriver component of Unreal Engine.

The value of this variable is set as a console variable (CVar) with a default value of false. It can be changed at runtime through the console or configuration files.

The associated variable CVarAddNetDriverInfoToNetAnalytics directly interacts with net.AddNetDriverInfoToNetAnalytics. They share the same value and purpose.

Developers must be aware that enabling this variable will impact performance and memory usage, as it will cause additional information to be added to the NetAnalytics cache. This should be used primarily for debugging or detailed network analysis purposes.

Best practices when using this variable include:

  1. Only enable it when necessary for network debugging or analysis.
  2. Be mindful of the performance impact when enabled in production environments.
  3. Use in conjunction with other network analysis tools for comprehensive debugging.

Regarding the associated variable CVarAddNetDriverInfoToNetAnalytics:

The purpose of CVarAddNetDriverInfoToNetAnalytics is identical to net.AddNetDriverInfoToNetAnalytics. It’s an auto console variable that controls the addition of NetDriver information to the NetAnalytics cache.

This variable is used in the Engine module, specifically within the NetDriver component. It’s directly checked in the SendNetAnalytics function of the UNetDriver class.

The value is set when the auto console variable is created, with a default value of false. It can be changed at runtime through the console or configuration files.

CVarAddNetDriverInfoToNetAnalytics directly determines whether NetDriver information is added to the NetAnalytics cache. When true, it causes the SendNetAnalytics function to add additional attributes to the analytics data.

Developers should be aware that this variable’s state affects the amount of data collected for network analytics. Enabling it will increase the verbosity of network analytics data.

Best practices for using CVarAddNetDriverInfoToNetAnalytics include:

  1. Use it in development and testing environments for detailed network analysis.
  2. Be cautious about enabling it in production, considering the performance implications.
  3. Coordinate its use with other network debugging and profiling tools for comprehensive analysis.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:428

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarAddNetDriverInfoToNetAnalytics(
	TEXT("net.AddNetDriverInfoToNetAnalytics"),
	false,
	TEXT("Automatically add NetDriver information to the NetAnalytics cache"));

namespace UE::Net
{
	static FString GRequiredEncryptionNetDriverDefNames_Internal = TEXT("all");

#Associated Variable and Callsites

This variable is associated with another variable named CVarAddNetDriverInfoToNetAnalytics. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:427

Scope: file

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<bool> CVarAddNetDriverInfoToNetAnalytics(
	TEXT("net.AddNetDriverInfoToNetAnalytics"),
	false,
	TEXT("Automatically add NetDriver information to the NetAnalytics cache"));

namespace UE::Net
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/NetDriver.cpp:2159

Scope (from outer to inner):

file
function     void UNetDriver::SendNetAnalytics

Source code excerpt:


	// Add the default NetDriver information if requested
	if (CVarAddNetDriverInfoToNetAnalytics.GetValueOnAnyThread())
	{
		SetNetAnalyticsAttributes(TEXT("NetDriverName"), NetDriverName.ToString());
		SetNetAnalyticsAttributes(TEXT("NetDriverDefinition"), NetDriverDefinition.ToString());
		SetNetAnalyticsAttributes(TEXT("ReplicationModel"), GetReplicationModelName());
		SetNetAnalyticsAttributes(TEXT("NetMode"), ToString(GetNetMode()));
	}