Don't run Prometheus metrics on the client.

This commit is contained in:
Pieter-Jan Briers
2020-07-20 01:01:35 +02:00
parent 5e448f20c0
commit f6e900e6fd
2 changed files with 12 additions and 2 deletions

View File

@@ -393,7 +393,8 @@ namespace Robust.Server
_mainLoop = new GameLoop(_time)
{
SleepMode = SleepMode.Delay,
DetectSoftLock = true
DetectSoftLock = true,
EnableMetrics = true
};
}

View File

@@ -87,6 +87,8 @@ namespace Robust.Shared.Timing
/// </summary>
public bool DetectSoftLock { get; set; }
public bool EnableMetrics { get; set; } = false;
/// <summary>
/// The method currently being used to limit the Update rate.
/// </summary>
@@ -186,7 +188,14 @@ namespace Robust.Shared.Timing
try
{
#endif
using (_frameTimeHistogram.NewTimer())
if (EnableMetrics)
{
using (_frameTimeHistogram.NewTimer())
{
Tick?.Invoke(this, simFrameEvent);
}
}
else
{
Tick?.Invoke(this, simFrameEvent);
}