Files
UnrealEngineUWP/Engine/Source/Runtime/PerfCounters/Private/ZeroLoad.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

49 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "HAL/ThreadSafeCounter.h"
#include "ProfilingDebugging/Histogram.h"
#include "HAL/Runnable.h"
class FZeroLoad : public FRunnable
{
/** signal request to stop and exit thread */
FThreadSafeCounter ExitRequest;
/** Tick frequency, HZ */
double TickRate;
/** Histogram of thread loop times, not accessed outside of the thread */
FHistogram TickTimeHistogram;
/** Guards access to hitch messages */
FCriticalSection HitchMessagesLock;
/** Hitches that have not yet been logged */
TArray<FString> HitchMessagesToBeLogged;
/** Adds a message to log. We avoid calling UE_LOG directly since this can add locks at unpredictable times. */
void AddHitchMessage(double HitchDurationInMs);
public:
// FRunnable interface
virtual bool Init() override;
virtual uint32 Run() override;
virtual void Stop() override;
virtual void Exit() override;
// end of FRunnable interface
/** Gets messages to log - can block. */
bool GetHitchMessages(TArray<FString>& OutArray);
/** Gets frame time histogram - not guarded, should only be accessed after thread has stopped! */
bool GetFrameTimeHistogram(FHistogram& OutHistogram);
FZeroLoad(double InTickRate);
FZeroLoad(double InTickRate, const TArray<double>& FrameTimeHistogramBucketsMs);
virtual ~FZeroLoad() { }
};