Updated PM, uses 60s average to match message update time, modified message to display Server Running Time(Total Time Elapsed) in h:m:s.ms format
Readded perviously removed update interval condition
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Barotrauma
|
||||
|
||||
private double tickrate60stimer = 0;
|
||||
|
||||
private static Queue<double> tickrate10s = new Queue<double>(10);
|
||||
private static Queue<double> tickrate60s = new Queue<double>(61);
|
||||
|
||||
public int ItemCount
|
||||
{
|
||||
@@ -65,7 +65,7 @@ namespace Barotrauma
|
||||
{
|
||||
get
|
||||
{
|
||||
return tickrate10s.Count > 0 ? tickrate10s.Average() : 60;
|
||||
return tickrate60s.Count > 0 ? tickrate60s.Average() : 60;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,14 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public TimeSpan TimeElapsed
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromMilliseconds(TotalTimeElapsed);
|
||||
}
|
||||
}
|
||||
|
||||
public float MemoryUsage
|
||||
{
|
||||
get
|
||||
@@ -114,14 +122,14 @@ namespace Barotrauma
|
||||
{
|
||||
TotalTicks += 1;
|
||||
LastSecondTicks += 1;
|
||||
if(tickrate10s.Count >= 10)
|
||||
if (tickrate60s.Count > 60)
|
||||
{
|
||||
tickrate10s.Dequeue();
|
||||
tickrate60s.Dequeue();
|
||||
}
|
||||
if (TotalTimeElapsed - 1000 >= tickratetimer)
|
||||
{
|
||||
RealTickRate = LastSecondTicks / (TotalTimeElapsed - tickratetimer) * 1000;
|
||||
tickrate10s.Enqueue(RealTickRate);
|
||||
tickrate60s.Enqueue(RealTickRate);
|
||||
tickratetimer = TotalTimeElapsed;
|
||||
LastSecondTicks = 0;
|
||||
}
|
||||
@@ -163,8 +171,8 @@ namespace Barotrauma
|
||||
$"Max Tick Rate: {TickRateHigh}\n" +
|
||||
$"Total Ticks: {TotalTicks}\n" +
|
||||
$"All time Average Tick Rate: {AverageTickRate}\n" +
|
||||
$"10s Average Tick Rate: {AverageTickRate10s}\n" +
|
||||
$"Total Time Elapsed: {TotalTimeElapsed}\n" +
|
||||
$"60s Average Tick Rate: {AverageTickRate10s}\n" +
|
||||
$"Server Run Time: {TimeElapsed}\n" +
|
||||
$"Memory Usage: {MemoryUsage}\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -692,11 +692,11 @@ namespace Barotrauma
|
||||
GameMain.PerformanceCounter.AddElapsedTicks("Update:MapEntity:Misc", sw.ElapsedTicks);
|
||||
sw.Restart();
|
||||
#endif
|
||||
//TODO: Divide ItemList into different parts to update
|
||||
Task ItemTask = Task.Factory.StartNew(() =>
|
||||
{
|
||||
Item.UpdatePendingConditionUpdates(deltaTime);
|
||||
//mapEntityUpdateTick % MapEntityUpdateInterval == 0
|
||||
if (true)
|
||||
if (mapEntityUpdateTick % MapEntityUpdateInterval == 0)
|
||||
{
|
||||
Item lastUpdatedItem = null;
|
||||
|
||||
|
||||
@@ -230,6 +230,7 @@ namespace Barotrauma
|
||||
Level.Loaded.Update((float)deltaTime, Camera.Instance);
|
||||
}
|
||||
});
|
||||
//TODO: Divide CharacterList into different parts to update
|
||||
Task CharacterTask = Task.Factory.StartNew(() => Character.UpdateAll((float)deltaTime, Camera.Instance));
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user