![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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< IAnalyticsPropertyStore > | MakeStore (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< int32 > | ShutdownTypeCodeProperty = TEXT("ShutdownTypeCode") |
| static ANALYTICSET_API const TAnalyticsProperty< bool > | IsUserLoggingOutProperty = TEXT("IsUserLoggingOut") |
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.
| 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.
| ProcessName | The process tag name of the principal process. Ex. "Editor". |
| ProcessGroupId | A unique ID shared by the principal and subsidiary processes. This is how information created by various processes is associated. |
| UserId | The current analytics user ID. |
| AppId | The current application ID used by analytics to identify the application. |
| AppVersion | the current application version used by the analytics for this application. |
| SessionId | the current session ID assigned by the analytics. |
| SavedDir | The 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 | ( | 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.
| ProcessName | The process tag name of the subsidiary process. Ex. "CrashReportClient". |
| ProcessGroupId | A unique ID shared by the principal and subsidiary processes. This is how information created by various processes is associated. |
| PrincipalProcessId | The principal process ID to which this subsidiary process is associated. |
| SavedDir | The 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 | ( | ) |
Destructor.
|
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.
| SavedDir | The directory used to save the analytic files. If unspecified, use the internal default. |
Returns the age at which a session is considered expired and shouldn't be sent anymore.
| 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.
| InitialCapacity | The amount of space to reserve in the file. |
| 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.
| 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.
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.
| bDiscard | Whether the current session is discarded or not. Discarded sessions are not sent. |
| 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.
|
static |
Special key handled in CRC to decide if an abnormal shutdown crash report should be generated.
|
static |
Special key handled by the manager for the analytics backend. Its value must be one of EAnalyticsSessionShutdownType enum value.