Files
UnrealEngineUWP/Engine/Source/Runtime/StorageServerClient/Private/DebugStorageServerConnection.h
daniele pieroni 7bcdfb807b Adding throughput computation for ZenServer in StorageServerRequest on the client.
Adding CSV stats for ZenServer throughput and request count.
Adding real time debug graphs for ZenServer throughput and request count.
#rb tomasz.obrebski, Zousar.Shaker

[CL 33697675 by daniele pieroni in ue5-main branch]
2024-05-16 15:48:29 -04:00

62 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Engine/Canvas.h"
#include <vector>
#include "DebugStorageServerConnection.generated.h"
class FStorageServerConnection;
UCLASS()
class UDebugStorageServerConnection : public UObject
{
GENERATED_BODY()
public:
void StartDrawing();
void StopDrawing();
void AddTimingInstance(double duration, uint64 bytes);
void SetOwner(FStorageServerConnection* Connection)
{
Owner = Connection;
}
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;
FStorageServerConnection* Owner;
static bool ShowGraphs;
};