Files
UnrealEngineUWP/Engine/Source/Developer/EditorAnalyticsSession/Public/EditorSessionSummarySender.h
Patrick Laflamme 39beb94b81 #jira UETOOL-2873 - For MTBF, account for crashes happening before analytics is initialized.
- Count number of crashes before Analytics get initialized and report them as DelayedCrashCount field of the Editor summary session event.

#rb Jamie.Dale

[CL 15128718 by Patrick Laflamme in ue5-main branch]
2021-01-18 10:45:38 -04:00

43 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "Misc/DateTime.h"
#include "Misc/Optional.h"
#include "Containers/Map.h"
#include "Templates/Tuple.h"
struct FEditorAnalyticsSession;
class IAnalyticsProviderET;
struct FEditorAnalyticReportData;
/**
* Sender of SessionSummary events from all editor sessions in-between runs.
* Separated from Writer to make it easier to run it out-of-process.
*/
class EDITORANALYTICSSESSION_API FEditorSessionSummarySender
{
public:
FEditorSessionSummarySender(IAnalyticsProviderET& InAnalyticsProvider, const FString& InSenderName, const uint32 InCurrentSessionProcessId);
~FEditorSessionSummarySender();
void Tick(float DeltaTime);
void Shutdown();
void SetMonitorDiagnosticLogs(TMap<uint32, TTuple<FString, FDateTime>>&& Logs);
private:
/** Send any stored Sessions. */
void SendStoredSessions(const bool bForceSendCurrentSession = false) const;
void SendSessionSummaryEvent(const FEditorAnalyticReportData& ReportData) const;
private:
float HeartbeatTimeElapsed;
IAnalyticsProviderET& AnalyticsProvider;
FString Sender;
uint32 CurrentSessionProcessId;
TMap<uint32, TTuple<FString,FDateTime>> MonitorMiniLogs; // Maps Monitor Process ID/Monitor Log
};