2024-05-16 15:48:29 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Engine/Canvas.h"
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
#include "DebugStorageServerConnection.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS()
|
|
|
|
|
class UDebugStorageServerConnection : public UObject
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void StartDrawing();
|
|
|
|
|
void StopDrawing();
|
|
|
|
|
|
|
|
|
|
void AddTimingInstance(double duration, uint64 bytes);
|
|
|
|
|
|
2024-06-13 07:54:06 -04:00
|
|
|
void SetHostAddress(FString Address)
|
2024-05-16 15:48:29 -04:00
|
|
|
{
|
2024-06-13 07:54:06 -04:00
|
|
|
HostAddress = Address;
|
2024-05-16 15:48:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ShowGraph(FOutputDevice&);
|
|
|
|
|
static void HideGraph(FOutputDevice&);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void Draw(UCanvas* Canvas, class APlayerController* PC);
|
|
|
|
|
|
|
|
|
|
struct HistoryItem
|
|
|
|
|
{
|
|
|
|
|
double Time;
|
|
|
|
|
double MaxRequestThroughput;
|
|
|
|
|
double MinRequestThroughput;
|
|
|
|
|
double Throughput;
|
|
|
|
|
uint32 RequestCount;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::vector<HistoryItem> History = {{0, 0, 0, 0, 0}};
|
|
|
|
|
|
|
|
|
|
FDelegateHandle DrawHandle;
|
|
|
|
|
|
|
|
|
|
static constexpr float UpdateStatsTimer = 1.0;
|
|
|
|
|
double UpdateStatsTime = 0.0;
|
|
|
|
|
uint64 AccumulatedBytes = 0;
|
|
|
|
|
uint32 RequestCount = 0;
|
|
|
|
|
|
|
|
|
|
double MinRequestThroughput = 0.0;
|
|
|
|
|
double MaxRequestThroughput = 0.0;
|
|
|
|
|
|
|
|
|
|
FCriticalSection StatsCS;
|
2024-06-13 07:54:06 -04:00
|
|
|
FString HostAddress;
|
2024-05-16 15:48:29 -04:00
|
|
|
|
|
|
|
|
static bool ShowGraphs;
|
|
|
|
|
|
|
|
|
|
};
|