From 128321c655d1c5480df8a1496fafab5c0c75e5c7 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 23 Sep 2024 20:15:50 +0200 Subject: [PATCH] Fix network profiler to properly calculate network usage statistics per second #2815 --- Source/Editor/Windows/Profiler/Network.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Editor/Windows/Profiler/Network.cs b/Source/Editor/Windows/Profiler/Network.cs index fa5701db9..2c064351a 100644 --- a/Source/Editor/Windows/Profiler/Network.cs +++ b/Source/Editor/Windows/Profiler/Network.cs @@ -146,12 +146,11 @@ namespace FlaxEditor.Windows.Profiler avgStats.TotalDataSent += e.TotalDataSent; avgStats.TotalDataReceived += e.TotalDataReceived; } - avgStats.TotalDataSent /= (uint)_stats.Count; - avgStats.TotalDataReceived /= (uint)_stats.Count; + //avgStats.TotalDataSent /= (uint)_stats.Count; + //avgStats.TotalDataReceived /= (uint)_stats.Count; _dataSentRateChart.AddSample(avgStats.TotalDataSent); _dataReceivedRateChart.AddSample(avgStats.TotalDataReceived); - // Gather network events var events = ProfilingTools.EventsNetwork; if (_events == null) @@ -319,7 +318,7 @@ namespace FlaxEditor.Windows.Profiler private static string FormatCellBytes(object x) { - return Utilities.Utils.FormatBytesCount((ulong)x); + return Utilities.Utils.FormatBytesCount((ulong)(int)x); } private static int SortRows(Control x, Control y)