2024-05-16 15:48:29 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Engine/Canvas.h"
|
2024-08-15 10:01:59 -04:00
|
|
|
#include "HAL/CriticalSection.h"
|
2024-05-16 15:48:29 -04:00
|
|
|
#include <vector>
|
2024-08-06 11:00:25 -04:00
|
|
|
#include "IStorageServerPlatformFile.h"
|
2024-05-16 15:48:29 -04:00
|
|
|
|
2024-08-15 10:01:59 -04:00
|
|
|
#if !UE_BUILD_SHIPPING
|
|
|
|
|
class FStorageServerConnectionDebug
|
2024-05-16 15:48:29 -04:00
|
|
|
{
|
|
|
|
|
public:
|
2024-08-15 10:01:59 -04:00
|
|
|
FStorageServerConnectionDebug( IStorageServerPlatformFile* InStorageServerPlatformFile )
|
|
|
|
|
: StorageServerPlatformFile(InStorageServerPlatformFile)
|
|
|
|
|
, HostAddress(InStorageServerPlatformFile->GetHostAddr())
|
2024-05-16 15:48:29 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-15 10:01:59 -04:00
|
|
|
bool OnTick(float); // FTickerDelegate
|
|
|
|
|
void OnDraw(UCanvas*, APlayerController*); // FDebugDrawDelegate
|
2024-05-16 15:48:29 -04:00
|
|
|
|
|
|
|
|
private:
|
2024-08-15 10:01:59 -04:00
|
|
|
double MaxReqThroughput = 0.0;
|
|
|
|
|
double MinReqThroughput = 0.0;
|
|
|
|
|
uint32 ReqCount = 0;
|
|
|
|
|
double Throughput = 0.0;
|
2024-05-16 15:48:29 -04:00
|
|
|
|
|
|
|
|
struct HistoryItem
|
|
|
|
|
{
|
|
|
|
|
double Time;
|
|
|
|
|
double MaxRequestThroughput;
|
|
|
|
|
double MinRequestThroughput;
|
|
|
|
|
double Throughput;
|
|
|
|
|
uint32 RequestCount;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::vector<HistoryItem> History = {{0, 0, 0, 0, 0}};
|
|
|
|
|
|
|
|
|
|
static constexpr float UpdateStatsTimer = 1.0;
|
|
|
|
|
double UpdateStatsTime = 0.0;
|
|
|
|
|
|
2024-08-06 11:00:25 -04:00
|
|
|
IStorageServerPlatformFile* StorageServerPlatformFile = nullptr;
|
2024-06-13 07:54:06 -04:00
|
|
|
FString HostAddress;
|
2024-05-16 15:48:29 -04:00
|
|
|
|
2024-08-15 10:01:59 -04:00
|
|
|
FCriticalSection CS;
|
2024-05-16 15:48:29 -04:00
|
|
|
};
|
2024-08-15 10:01:59 -04:00
|
|
|
#endif // !UE_BUILD_SHIPPING
|