Add objects replication and RPC stats table to Network Profiler

This commit is contained in:
Wojtek Figat
2023-09-26 10:33:12 +02:00
parent da47088250
commit 6621e70ae7
10 changed files with 343 additions and 34 deletions

View File

@@ -3,6 +3,9 @@
#pragma once
#include "Types.h"
#if COMPILE_WITH_PROFILER
#include "Engine/Core/Collections/Dictionary.h"
#endif
enum class NetworkMessageIDs : uint8
{
@@ -35,4 +38,22 @@ public:
static void OnNetworkMessageObjectDespawn(NetworkEvent& event, NetworkClient* client, NetworkPeer* peer);
static void OnNetworkMessageObjectRole(NetworkEvent& event, NetworkClient* client, NetworkPeer* peer);
static void OnNetworkMessageObjectRpc(NetworkEvent& event, NetworkClient* client, NetworkPeer* peer);
#if COMPILE_WITH_PROFILER
struct ProfilerEvent
{
uint16 Count = 0;
uint16 DataSize = 0;
uint16 MessageSize = 0;
uint16 Receivers = 0;
};
/// <summary>
/// Enables network usage profiling tools. Captures network objects replication and RPCs send statistics.
/// </summary>
static bool EnableProfiling;
static Dictionary<Pair<ScriptingTypeHandle, StringAnsiView>, ProfilerEvent> ProfilerEvents;
#endif
};