UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAnalyticsSessionSummaryManager Class Reference

#include <AnalyticsSessionSummaryManager.h>

Public Member Functions

ANALYTICSET_API FAnalyticsSessionSummaryManager (const FString &ProcessName, const FString &ProcessGroupId, const FString &UserId, const FString &AppId, const FString &AppVersion, const FString &SessionId, const FString &SavedDir=TEXT(""))
 
ANALYTICSET_API FAnalyticsSessionSummaryManager (const FString &ProcessName, const FString &ProcessGroupId, uint32 PrincipalProcessId, const FString &SavedDir=TEXT(""))
 
ANALYTICSET_API ~FAnalyticsSessionSummaryManager ()
 
ANALYTICSET_API void Tick ()
 
ANALYTICSET_API TSharedPtr< IAnalyticsPropertyStoreMakeStore (uint32 InitialCapacity)
 
ANALYTICSET_API void SetSender (TSharedPtr< IAnalyticsSessionSummarySender > Sender)
 
ANALYTICSET_API void SetUserId (const FString &UserId)
 
ANALYTICSET_API void Shutdown (bool bDiscard=false)
 

Static Public Member Functions

static ANALYTICSET_API void CleanupExpiredFiles (const FString &SavedDir=TEXT(""))
 
static FTimespan GetSessionExpirationAge ()
 

Static Public Attributes

static ANALYTICSET_API const TAnalyticsProperty< int32ShutdownTypeCodeProperty = TEXT("ShutdownTypeCode")
 
static ANALYTICSET_API const TAnalyticsProperty< boolIsUserLoggingOutProperty = TEXT("IsUserLoggingOut")
 

Detailed Description

Manages the lifecycle of analytics summaries created by an application and its subsidiary processes. It manages the summary files created by the processes, tracks which processes are working together, aggregates the summaries from collaborating processes, discards outdated sessions and sends the final summary reports.

Several processes can collaborate to collect analytics for one principal process. The common case being the Editor acting as the principal process and CrashReportClient (CRC) acting as a subsidiary process. The principal process and its subsidiaries form a group of processes tied together. The last process of the group to exit is responsible to aggregates and sends the final report for the principal process. For any reasons, if the final report cannot be sent by a group, the responsibility to deal with the left over is put on the principal process. The principal process is responsible to clean up the left over from its previous execution(s) and possibly salvage and send reports delayed.

Constructor & Destructor Documentation

◆ FAnalyticsSessionSummaryManager() [1/2]

FAnalyticsSessionSummaryManager::FAnalyticsSessionSummaryManager ( const FString &  ProcessName,
const FString &  ProcessGroupId,
const FString &  UserId,
const FString &  AppId,
const FString &  AppVersion,
const FString &  SessionId,
const FString &  SavedDir = TEXT("") 
)

Constructs a manager for the principal process, usually the main application.

Parameters
ProcessNameThe process tag name of the principal process. Ex. "Editor".
ProcessGroupIdA unique ID shared by the principal and subsidiary processes. This is how information created by various processes is associated.
UserIdThe current analytics user ID.
See also
IAnalyticsProviderET
Parameters
AppIdThe current application ID used by analytics to identify the application.
See also
IAnalyticsProviderET
Parameters
AppVersionthe current application version used by the analytics for this application.
See also
IAnalyticsProviderET
Parameters
SessionIdthe current session ID assigned by the analytics.
See also
IAnalyticsProviderET
Parameters
SavedDirThe directory where files will be persisted. Should be the same for the principal and the subsidiary processes. If unspecified, the manager uses its internal default.

◆ FAnalyticsSessionSummaryManager() [2/2]

FAnalyticsSessionSummaryManager::FAnalyticsSessionSummaryManager ( const FString &  ProcessName,
const FString &  ProcessGroupId,
uint32  PrincipalProcessId,
const FString &  SavedDir = TEXT("") 
)

Constructs a manager for a subsidiary process, usually a companion process that collects extra information on the behalf of the principal process.

Parameters
ProcessNameThe process tag name of the subsidiary process. Ex. "CrashReportClient".
ProcessGroupIdA unique ID shared by the principal and subsidiary processes. This is how information created by various processes is associated.
PrincipalProcessIdThe principal process ID to which this subsidiary process is associated.
SavedDirThe directory where files will be persisted. Should be the same for the principal and the subsidiary processes. If unspecified, the manager uses its internal default.

◆ ~FAnalyticsSessionSummaryManager()

FAnalyticsSessionSummaryManager::~FAnalyticsSessionSummaryManager ( )

Destructor.

Member Function Documentation

◆ CleanupExpiredFiles()

void FAnalyticsSessionSummaryManager::CleanupExpiredFiles ( const FString &  SavedDir = TEXT(""))
static

Cleans up all expired files that match the analytics session filename pattern. The manager automaticallly clean up if it runs, but if the analytics is off and the manager is not instantiated anymore, some dead files can be left over.

Parameters
SavedDirThe directory used to save the analytic files. If unspecified, use the internal default.

◆ GetSessionExpirationAge()

static FTimespan FAnalyticsSessionSummaryManager::GetSessionExpirationAge ( )
inlinestatic

Returns the age at which a session is considered expired and shouldn't be sent anymore.

Returns
The expiration delay.

◆ MakeStore()

TSharedPtr< IAnalyticsPropertyStore > FAnalyticsSessionSummaryManager::MakeStore ( uint32  InitialCapacity)

Creates a new property store associated to this manager process group. The manager only sends an analytics session summary when all collecting processes have closed their property store. Ensure to flush and release the store before calling the manager Shutdown() to ensure the session is sent as soon a possible. Subsequent calls to MakeStore will increment an internal counter in the store's filename.

Parameters
InitialCapacityThe amount of space to reserve in the file.

◆ SetSender()

void FAnalyticsSessionSummaryManager::SetSender ( TSharedPtr< IAnalyticsSessionSummarySender Sender)

Sets a summary sender to enable the manager to send sessions. If the sender is null, the sessions are not sent. If the sender is set, the manager will periodically search and send pending sessions, usually the one left over from processes that died unexpectedly. As a rule, the principal process is responsible to send the left over summary sessions and a subsidiary process only sends the current sessions summary if it is the last process of the group to exit. The manager deletes the session data while sending.

◆ SetUserId()

void FAnalyticsSessionSummaryManager::SetUserId ( const FString &  UserId)

Sets a the user id used for reporting analytics. Allows for changing the application user after startup. Will set the user id on all existing stores created from this session summary manager.

◆ Shutdown()

void FAnalyticsSessionSummaryManager::Shutdown ( bool  bDiscard = false)

Shuts down and sends the session summaries that can be sent, if a sender is set. Remember to flush and discard the property store returned by MakeStore() before shutting down to prevent delaying the report.

Parameters
bDiscardWhether the current session is discarded or not. Discarded sessions are not sent.
See also
SetSender()
MakeStore()

◆ Tick()

void FAnalyticsSessionSummaryManager::Tick ( )

Discovers and salvages/sends/cleans up left over from previous execution(s), if any. Only the principal process can send left over sessions.

Member Data Documentation

◆ IsUserLoggingOutProperty

const TAnalyticsProperty< bool > FAnalyticsSessionSummaryManager::IsUserLoggingOutProperty = TEXT("IsUserLoggingOut")
static

Special key handled in CRC to decide if an abnormal shutdown crash report should be generated.

◆ ShutdownTypeCodeProperty

const TAnalyticsProperty< int32 > FAnalyticsSessionSummaryManager::ShutdownTypeCodeProperty = TEXT("ShutdownTypeCode")
static

Special key handled by the manager for the analytics backend. Its value must be one of EAnalyticsSessionShutdownType enum value.


The documentation for this class was generated from the following files: