Open CosmicStud opened 1 year ago
I added the package from the disk, added a small counter, if its more then my max, it wont print, it resets the log count if not over the limit
`internal MetricDispatcher(MetricCollection collection, IReadOnlyList
public void RegisterObserver(IMetricObserver observer)
{
m_Observers.Add(observer);
}
public void SetConnectionId(ulong connectionId)
{
m_Collection.ConnectionId = connectionId;
}
private int logCount = 0;
public void Dispatch()
{
var wentOverLimit = false;
for (var i = 0; i < m_EventMetrics.Count; i++)
{
if (m_EventMetrics[i].WentOverLimit)
{
wentOverLimit = true;
break;
}
}
//Added custom code to increment and check log count
if (wentOverLimit && logCount < 1)
{
logCount += 1;
Debug.LogWarning(k_ThrottlingWarning);
}
//Added custom code to reset log counter
else
{
logCount = 0;
}
for (var i = 0; i < m_Observers.Count; i++)
{
var snapshotObserver = m_Observers[i];
snapshotObserver.Observe(m_Collection);
}
for (var i = 0; i < m_Resettables.Count; i++)
{
var resettable = m_Resettables[i];
if (resettable.ShouldResetOnDispatch)
{
resettable.Reset();
}
}
}`
//Changed log count due to my needs and a lot of spam `public void Dispatch() { var wentOverLimit = false; for (var i = 0; i < m_EventMetrics.Count; i++) { if (m_EventMetrics[i].WentOverLimit) { wentOverLimit = true; break; } }
if (wentOverLimit)
{
logCount += 1;
if (logCount == 200)
{
logCount = 0;
Debug.LogWarning(k_ThrottlingWarning);
}
}
for (var i = 0; i < m_Observers.Count; i++)
{
var snapshotObserver = m_Observers[i];
snapshotObserver.Observe(m_Collection);
}
for (var i = 0; i < m_Resettables.Count; i++)
{
var resettable = m_Resettables[i];
if (resettable.ShouldResetOnDispatch)
{
resettable.Reset();
}
}
}`
Okay, did not notice that.
There is another log, although not spammed as much. If a custom build is completed it'll send more than a few of these
Runtime Net Stats Monitor (RNSM) implementation disabled in release build targeting StandaloneLinux64
The log is located in the package "Unity.Multiplayer.Tools", class "NetStatsMonitorBuildLogEntry", "OnPostprocessBuild" method
Hello @CosmicStud in November our team did some work to improve metric throttling. It would have shipped out with our Tools 1.1.0 release. Can you confirm if you're still seeing it along with that version? Thank you.
Description
In the package "Multiplayer Tools", The "MeticDispatcher" class, "Dispatch" method spams a warning of metrics over the limit, it tends to lower fps when viewing console on builds, and makes dev logging much more difficult
Reproduce Steps
Send network messages in abundance
Actual Outcome
Messages are sent and received successfully, though there are spammed logs every frame
Expected Outcome
Maybe a few logs to alert of the limits of the profiler, not spammed
Environment