Files
UnrealEngineUWP/Engine/Source/Runtime/AutomationWorker/Private/AutomationAnalytics.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

63 lines
2.1 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "AutomationAnalyticParams.h"
class IAnalyticsProvider;
class IAnalyticsProviderET;
struct FAnalyticsEventAttribute;
struct FAutomationPerformanceSnapshot;
struct FAutomationWorkerRunTestsReply;
class FAutomationAnalytics : FNoncopyable
{
public:
/**
* Return the provider instance. Not valid outside of Initialize/Shutdown calls.
* Note: must check IsAvailable() first else this code will assert if the provider is not valid.
*/
static IAnalyticsProvider& GetProvider();
/** Helper function to determine if the provider is valid. */
static bool IsAvailable() { return Analytics.IsValid(); }
/** Called to initialize the singleton. */
static void Initialize();
/** Called to shut down the singleton */
static void Shutdown();
/*
* Helper function to retrieve the parameter name from a given enum
*/
static FString GetAutomationEventName(EAutomationEventName::Type InEventName);
static FString GetAutomationParamName(EAutomationAnalyticParam::Type InEngineParam);
static void InititalizeAnalyticParameterNames();
/** Helper to check if the Analytics provider is Initialized */
static bool IsInitialized();
//////////////////////////////////////////////////////////////////////////
// Events
//////////////////////////////////////////////////////////////////////////
//FPSCapture Event
static void FireEvent_FPSCapture(const FAutomationPerformanceSnapshot& PerfSnapshot);
//AutomationTest Event
static void FireEvent_AutomationTestResults(const FAutomationWorkerRunTestsReply* TestResults, const FString& BeautifiedTestName);
private:
static void SetInitialParameters(TArray<FAnalyticsEventAttribute>& ParamArray);
/** Array of Analytic Parameter names */
static TArray<FString> AutomationEventNames;
static TArray<FString> AutomationParamNames;
static FString MachineSpec;
static bool bIsInitialized;
/** This allows us to "opt-out" of engine automation analytics. We still create a session, but we don't send any automation events. */
static TSharedPtr<IAnalyticsProviderET> Analytics;
};