Fix network profiler to properly calculate network usage statistics per second

#2815
This commit is contained in:
Wojtek Figat
2024-09-23 20:15:50 +02:00
parent d2c35e8591
commit 128321c655

View File

@@ -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)