This commit is contained in:
Tiphaine Rousseau 2024-10-31 14:44:05 +01:00
Родитель 3bb6ba49b3
Коммит dca73bfc99
5 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -279,7 +279,7 @@ namespace Unity.Netcode
StringConversionUtility.ConvertToFixedString(networkObject.GetNameForMetrics()),
networkObject.NetworkObjectId,
StringConversionUtility.ConvertToFixedString(rpcName),
StringConversionUtility.ConvertToFixedString(networkObject.GetNameForMetrics()),
StringConversionUtility.ConvertToFixedString(networkBehaviourName),
bytesCount);
IncrementMetricCount();
}

Просмотреть файл

@ -100,9 +100,6 @@ namespace Unity.Multiplayer.Tools.Adapters.Ngo1
nm.OnMetricsDispatched -= NotifyObservers;
}
m_NetworkManager.NetworkMetrics = null;
m_NetworkManager = null;
m_Collection = null;
}
private readonly List<ClientId> m_ClientIds = new();

Просмотреть файл

@ -31,9 +31,9 @@ namespace Unity.Netcode.TestHelpers.Runtime.Metrics
{
ServerMetrics = Server.NetworkMetrics as NetworkMetrics;
ClientMetrics = Client.NetworkMetrics as NetworkMetrics;
yield return base.OnStartedServerAndClients();
ServerMetricsDispatcher = new TestDispatcher(ServerMetrics);
ClientMetricsDispatcher = new TestDispatcher(ClientMetrics);
yield return base.OnStartedServerAndClients();
}
}
@ -72,10 +72,11 @@ namespace Unity.Netcode.TestHelpers.Runtime.Metrics
ServerMetrics = Server.NetworkMetrics as NetworkMetrics;
FirstClientMetrics = FirstClient.NetworkMetrics as NetworkMetrics;
SecondClientMetrics = SecondClient.NetworkMetrics as NetworkMetrics;
yield return base.OnStartedServerAndClients();
ServerMetricsDispatcher = new TestDispatcher(ServerMetrics);
FirstClientMetricsDispatcher = new TestDispatcher(FirstClientMetrics);
SecondClientMetricsDispatcher = new TestDispatcher(SecondClientMetrics);
yield return base.OnStartedServerAndClients();
}
}

Просмотреть файл

@ -54,7 +54,7 @@ namespace Unity.Netcode.RuntimeTests.Metrics
{
foreach (var clientNetworkManager in m_ClientNetworkManagers)
{
var dispatcher = new TestDispatcher((NetworkMetrics)m_ServerNetworkManager.NetworkMetrics);
var dispatcher = new TestDispatcher((NetworkMetrics)clientNetworkManager.NetworkMetrics);
var waitForGaugeValues = new WaitForGaugeMetricValues(dispatcher, NetworkMetricTypes.ConnectedClients);
yield return waitForGaugeValues.WaitForMetricsReceived();

Просмотреть файл

@ -210,7 +210,7 @@ namespace Unity.Netcode.RuntimeTests.Metrics
//By default, we have 2 network objects
//There's a slight delay between the spawn on the server and the spawn on the client
//We want to have metrics when the value is different than the 2 default one to confirm the client has the new value
//We want to have metrics when the value is different from the 2 default one to confirm the client has the new value
var waitForGaugeValues = new WaitForGaugeMetricValues(ClientMetricsDispatcher, NetworkMetricTypes.NetworkObjects, metric => (int)metric != 2);
yield return waitForGaugeValues.WaitForMetricsReceived();