Files
UnrealEngineUWP/Engine/Source/Runtime/StorageServerClient/Private/DebugStorageServerConnection.h
dmytro ivanov 7cc8ba51b4 Refactor Zen storage module to be able to use other HTTP clients
#jira UE-189687
#rb tomasz.obrebski

[CL 34336030 by dmytro ivanov in ue5-main branch]
2024-06-13 07:54:06 -04:00

60 lines
1.1 KiB
C++

// 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);
void SetHostAddress(FString Address)
{
HostAddress = Address;
}
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;
FString HostAddress;
static bool ShowGraphs;
};