Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
58fb9c5
Initial reference and NetworkMetrics
May 13, 2021
9607742
Implement profiling decorator and network metrics for named messages
May 20, 2021
76f074a
Add dummy dispatch frame
May 20, 2021
cf5c7ac
Move dispatch frame
May 21, 2021
433a8ca
Move references
May 21, 2021
29bf74e
Fix namespace reference
May 26, 2021
3a796d6
Merge remote-tracking branch 'origin/develop' into experimental/netst…
May 28, 2021
103cd52
Client Connection Ids and Game Object registration (#863)
Jun 3, 2021
77766fa
feat: Add test for named message sent and named message received metr…
bendoyon Jun 4, 2021
0ed7634
feat: Add implementation and tests for unnamed message metrics (#866)
bendoyon Jun 4, 2021
d966c53
Implement metrics for network variable deltas (#884)
bendoyon Jun 8, 2021
2d57298
Merge remote-tracking branch 'origin/develop' into experimental/netst…
Jun 8, 2021
789bf16
Removing duplicate
Jun 8, 2021
eae4c52
Fix merge
Jun 8, 2021
357d047
Merge fix
Jun 8, 2021
294a4f4
Rename and move messaging metrics tests
Jun 9, 2021
d81f078
Fix merge errors
Jun 9, 2021
e7923e6
Merge remote-tracking branch 'origin/experimental/netstats-dispatcher…
Jun 9, 2021
8aa95b2
Add helper to wait for metric values in tests (#896)
bendoyon Jun 9, 2021
267c955
Fail when metric values haven't been found
Jun 10, 2021
a0c32a4
Add conditional define for the tools library (#908)
bendoyon Jun 17, 2021
5f2ae3c
Merge remote-tracking branch 'origin/develop' into experimental/netst…
Jun 17, 2021
e1d8187
Merge branch 'develop' into experimental/netstats-dispatcher
Jun 29, 2021
4360413
feat: Report metrics when network objects are spawned or destroyed/de…
Jun 30, 2021
c009c3a
chore: Compile out file when tool isn’t present (#953)
kvassall-unity Jul 12, 2021
78160ae
feat: Add metrics for multiple objects spawned and destroyed (i.e. Ne…
Jul 12, 2021
8b56bd6
feat: RPC Event Net stat reporting (#954)
Jul 14, 2021
c11bb95
Fix tests to use properly registered network prefabs (#962)
Jul 14, 2021
e92bd4a
Updated to match tools PR that decouples network profiler references …
becksebenius-unity Jul 14, 2021
3d0b462
Compilation fix
Jul 15, 2021
fec815b
Feat: Server logs metrics (#956)
Jul 19, 2021
8b907ab
Experimental/netstats/review fixes (#970)
bendoyon Jul 21, 2021
954d983
Track ownership change events (#931)
bendoyon Jul 21, 2021
089341d
Move common metrics test initialization to utility class (#973)
bendoyon Jul 22, 2021
62b2776
Assert byte counts for metrics (#975)
bendoyon Jul 26, 2021
32dc732
Merge branch 'develop' into experimental/netstats-dispatcher
Jul 27, 2021
b5c9619
Merge fixes
Jul 27, 2021
cedf84b
Fix buffer size tracking
Jul 27, 2021
c080059
Fix named message stream copyto
Jul 27, 2021
89a65e6
Make network object tests use the base class
Jul 27, 2021
7e43ebe
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Jul 28, 2021
44fba87
test: added an empty test project that includes the tools package (#1…
becksebenius-unity Aug 4, 2021
31528b1
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Aug 4, 2021
bc27124
Updated tools package testing to 0.0.1-preview.1
becksebenius-unity Aug 4, 2021
e318716
missed updating the packages-lock.json in previous commit
becksebenius-unity Aug 4, 2021
46b76b6
Code review fixes
Aug 9, 2021
c379ceb
Merge branch 'develop' into experimental/netstats-dispatcher
Aug 9, 2021
6c9bfda
Code review fixes
Aug 9, 2021
73d4c3a
Code review fixes
Aug 10, 2021
cfbcec6
Code review fixes
Aug 10, 2021
8ec8e75
Merge branch 'develop' into experimental/netstats-dispatcher
Aug 10, 2021
22bfc44
Merge branch 'develop' into experimental/netstats-dispatcher
bendoyon Aug 10, 2021
f0f4479
Force CI
Aug 10, 2021
6b551b4
Revert "Force CI"
Aug 10, 2021
c321d9a
Merge branch 'develop' into experimental/netstats-dispatcher
bendoyon Aug 10, 2021
44f7e38
fix: updated some missed cases where test_editors was still used (#1039)
becksebenius-unity Aug 10, 2021
470941e
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Aug 10, 2021
895bc06
Fixed ObjectDestroy metric not being sent when NetworkHide is used (#…
becksebenius-unity Aug 11, 2021
646cd41
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Aug 11, 2021
e455770
Avoid string allocation when printing variable name by sanitizing on …
bendoyon Aug 11, 2021
d0229cd
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Aug 11, 2021
821bda4
fix: pull request trigger name does not match the one configured in g…
becksebenius-unity Aug 11, 2021
8537728
Merge branch 'develop' into experimental/netstats-dispatcher
becksebenius-unity Aug 12, 2021
e1152ca
fix: ported over the actual trigger data for the legacy trigger so it…
becksebenius-unity Aug 12, 2021
80a32a5
Fixing testproject-tools-integration failure
becksebenius-unity Aug 12, 2021
44ef79d
Merge branch 'experimental/netstats-dispatcher' of github.com:Unity-T…
becksebenius-unity Aug 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .yamato/_run-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ run_all_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
Expand All @@ -21,9 +21,9 @@ all_project_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
- .yamato/project-tests.yml#test_{{ projects.first.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
Expand All @@ -34,11 +34,11 @@ all_package_tests:
dependencies:
# Pull in package and validate jobs through the badges job
- .yamato/_triggers.yml#badges_test_trigger
{% for editor in test_editors -%}
{% for platform in test_platforms -%}
{% for project in projects -%}
{% for editor in project.test_editors -%}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
Expand Down
34 changes: 27 additions & 7 deletions .yamato/_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,39 @@ develop_nightly_trigger:
- .yamato/code-coverage.yml#code_coverage_win_{{ project.name }}
{% endfor -%}

# Legacy job that matches the name with branch protections as of 8/11
# Can be removed once branch protections are updated to the new name
pull_request_trigger_legacy:
name: Pull Request Trigger on 2021.1 (master, develop, & release branches)
dependencies:
- .yamato/_triggers.yml#pull_request_trigger
triggers:
cancel_old_ci: true
pull_requests:
- targets:
only:
- "master"
- "develop"
- "/release\/.*/"

# Run all relevant tasks when a pull request targeting the develop
# branch is created or updated. Currently only netcode package tests are
# enabled, since the others are missing test coverage and will fail CI.
pull_request_trigger:
name: Pull Request Trigger on {{ test_editors.first }} (master, develop, & release branches)
name: Pull Request Trigger (master, develop, & release branches)
dependencies:
- .yamato/project-standards.yml#standards_{{ projects.first.name }}
{% for project in projects -%}
{% for package in project.packages -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% if project.validate == "true" -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endif -%}
{% endfor -%}
{% for platform in test_platforms -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ test_editors.first }}_{{ platform.name }}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ test_editors.first }}_{{ platform.name }}
{% for package in project.packages -%}
- .yamato/package-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ project.test_editors.first }}_{{ platform.name }}
{% endfor -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ project.test_editors.first }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
triggers:
Expand Down Expand Up @@ -59,10 +77,12 @@ badges_test_trigger:
dependencies:
{% for project in projects -%}
{% for package in project.packages -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
{% if project.validate == "true" -%}
- .yamato/project-tests.yml#validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endif -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/package-tests.yml#test_{{ package.name }}_{{ editor }}_{{ platform.name }}
- .yamato/package-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ editor }}_{{ platform.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
Expand Down
14 changes: 8 additions & 6 deletions .yamato/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
# to generate its independent package tests and validation tests.
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for project in projects -%}
{% for package in project.packages -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
test_{{ package.name }}_{{ editor }}_{{ platform.name }}:
name : {{ package.name }} package tests - {{ editor }} on {{ platform.name }}
test_{{project.name}}_{{ package.name }}_{{ editor }}_{{ platform.name }}:
name : {{ project.name }} - {{ package.name }} package tests - {{ editor }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --type package-tests --project-path {{ projects.first.name }} --package-filter {{ package.name }}
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ editor }} --type package-tests --project-path {{ project.name }} --package-filter {{ package.name }}
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ projects.first.name }}
- .yamato/project-pack.yml#pack_{{ project.name }}
{% endfor -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}
10 changes: 5 additions & 5 deletions .yamato/project-promotion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% for package in project.packages -%}
# Validation job for package {{ package.name }}, only using the first entry in the
# platform and editor meta data
promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Project {{ project.name }} - Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}:
name : Validate Project {{ project.name }} - Package {{ package.name }} - {{ validation_editor }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
Expand All @@ -14,7 +14,7 @@ promotion_validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first
UPMCI_PROMOTION: 1
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ test_editors.first }} --project-path {{ project.path }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }}
- upm-ci project test -u {{ validation_editor }} --project-path {{ project.path }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }}
artifacts:
logs:
paths:
Expand All @@ -39,7 +39,7 @@ promote_{{ project.name }}_{{ package.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.name }}_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.name }}_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}

{% endfor -%}

Expand All @@ -60,5 +60,5 @@ promote_{{ project.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
- .yamato/project-promotion.yml#promotion_validate_{{ project.packages.first.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% endfor -%}
4 changes: 2 additions & 2 deletions .yamato/project-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ publish_{{ project.name }}_{{ package.name }}:
- "upm-ci~/packages/*.tgz"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
- .yamato/project-tests.yml#validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}
{% for editor in test_editors -%}
- .yamato/project-tests.yml#validate_{{ project.name }}_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-tests.yml#test_{{ project.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
Expand Down
2 changes: 1 addition & 1 deletion .yamato/project-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ standards_{{ projects.first.name }}:
- $HOME/.dotnet/tools/dotnet-format --version
- python3 --version
- pip install unity-downloader-cli --upgrade --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
- unity-downloader-cli -u {{ test_editors.first }} -c editor --wait --fast
- unity-downloader-cli -u {{ projects.first.test_editors.first }} -c editor --wait --fast
- .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ projects.first.path }} -quit
- ./standards.py --tool-path $HOME/.dotnet/tools/dotnet-format --project-path {{ projects.first.path }} --yamato
10 changes: 6 additions & 4 deletions .yamato/project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@
# Validation only occurs in editmode.

{% for project in projects -%}
{% if project.validate == "true" %}
{% for package in project.packages -%}
validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ test_editors.first }}:
name : Validate Package {{ package.name }} - {{ test_editors.first }} on {{ test_platforms.first.name }}
validate_{{ package.name }}_{{ test_platforms.first.name }}_{{ validation_editor }}:
name : Validate Package {{ package.name }} - {{ validation_editor }} on {{ test_platforms.first.name }}
agent:
type: {{ test_platforms.first.type }}
image: {{ test_platforms.first.image }}
flavor: {{ test_platforms.first.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ test_editors.first }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }} --platform editmode
- {% if platform.name == "centos" %}DISPLAY=:0 {% endif %}upm-ci project test -u {{ validation_editor }} --type vetting-tests --project-path {{ project.path }} --package-filter {{ package.name }} --platform editmode
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/project-pack.yml#pack_{{ project.name }}
{% endfor -%}
{% endif -%}
{% endfor -%}

# For every platform and editor version, run its project tests without
# running package tests too since they are handled on their respective
# jobs
{% for project in projects -%}
{% for editor in test_editors -%}
{% for editor in project.test_editors -%}
{% for platform in test_platforms -%}
test_{{ project.name }}_{{ editor }}_{{ platform.name }}:
name : {{ project.name }} project tests - {{ editor }} on {{ platform.name }}
Expand Down
4 changes: 2 additions & 2 deletions .yamato/project-updated-dependencies-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# The idea is to only run validation once per package and not mix.
# the results with package tests
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for editor in projects.first.test_editors -%}
{% for platform in test_platforms -%}
dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}:
name : Dependency Test of Project {{ projects.first.name }} - Package {{ package.name }} - {{ editor }} on {{ platform.name }}
Expand Down Expand Up @@ -51,7 +51,7 @@ dependency_test_trigger_{{ projects.first.name }}:
frequency: 22 * * ?
dependencies:
{% for package in projects.first.packages -%}
{% for editor in test_editors -%}
{% for editor in projects.first.test_editors -%}
{% for platform in test_platforms -%}
- .yamato/project-updated-dependencies-test.yml#dependency_{{ projects.first.name }}_{{ package.name }}_{{ platform.name }}_{{ editor }}
{% endfor -%}
Expand Down
23 changes: 13 additions & 10 deletions .yamato/project.metafile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# Editors where tests will happen. The first entry of this array is also used
# for validation.
#
# Therefore, **do not** put an older V1-lifecycle ver.
# like 2020.x or 2019.x on top of 'test_editors'
test_editors:
- 2021.1
- 2021.2
- 2020.3
- trunk
validation_editor: 2021.1

# Platforms that will be tested. The first entry in this array will also
# be used for validation
Expand All @@ -30,9 +21,21 @@ test_platforms:
projects:
- name: testproject
path: testproject
validate: true
# Packages within a project that will be tested
packages:
- name: com.unity.netcode.gameobjects
path: com.unity.netcode.gameobjects
- name: com.unity.multiplayer.transport.utp
path: com.unity.multiplayer.transport.utp
test_editors:
- 2021.1
- 2021.2
- 2020.3
- trunk
- name: testproject-tools-integration
path: testproject-tools-integration
validate: false
test_editors:
- 2021.2
- trunk
38 changes: 23 additions & 15 deletions com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ internal void __endSendServerRpc(NetworkSerializer serializer, uint rpcMethodId,

SetUpdateStage(ref serverRpcParams.Send);

var messageQueueContainer = NetworkManager.MessageQueueContainer;
if (IsHost)
{
messageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Inbound, serverRpcParams.Send.UpdateStage);
}
else
var rpcMessageSize = IsHost
? NetworkManager.MessageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Inbound, serverRpcParams.Send.UpdateStage)
: NetworkManager.MessageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Outbound, NetworkUpdateStage.PostLateUpdate);

if (NetworkManager.__rpc_name_table.TryGetValue(rpcMethodId, out var rpcMethodName))
{
messageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Outbound, NetworkUpdateStage.PostLateUpdate);
NetworkManager.NetworkMetrics.TrackRpcSent(NetworkManager.ServerClientId, NetworkObjectId, rpcMethodName, rpcMessageSize);
}
}

Expand Down Expand Up @@ -189,8 +188,6 @@ internal void __endSendClientRpc(NetworkSerializer serializer, uint rpcMethodId,

SetUpdateStage(ref clientRpcParams.Send);

var messageQueueContainer = NetworkManager.MessageQueueContainer;

if (IsHost)
{
ulong[] clientIds = clientRpcParams.Send.TargetClientIds ?? NetworkManager.ConnectedClientsIds;
Expand All @@ -202,12 +199,18 @@ internal void __endSendClientRpc(NetworkSerializer serializer, uint rpcMethodId,
var containsServerClientId = clientIds.Contains(NetworkManager.ServerClientId);
if (containsServerClientId && clientIds.Length == 1)
{
messageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Inbound, clientRpcParams.Send.UpdateStage);
NetworkManager.MessageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Inbound, clientRpcParams.Send.UpdateStage);

return;
}
}

messageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Outbound, NetworkUpdateStage.PostLateUpdate);
var messageSize = NetworkManager.MessageQueueContainer.EndAddQueueItemToFrame(serializer.Writer, MessageQueueHistoryFrame.QueueFrameType.Outbound, NetworkUpdateStage.PostLateUpdate);

if (NetworkManager.__rpc_name_table.TryGetValue(rpcMethodId, out var rpcMethodName))
{
NetworkManager.NetworkMetrics.TrackRpcSent(NetworkManager.ConnectedClients.Select(x => x.Key).ToArray(), NetworkObjectId, rpcMethodName, messageSize);
}
}

/// <summary>
Expand Down Expand Up @@ -406,7 +409,8 @@ internal void InitializeVariables()
instance.SetNetworkBehaviour(this);

var instanceNameProperty = fieldType.GetProperty(nameof(INetworkVariable.Name));
instanceNameProperty?.SetValue(instance, sortedFields[i].Name);
var sanitizedVariableName = sortedFields[i].Name.Replace("<", string.Empty).Replace(">k__BackingField", string.Empty);
instanceNameProperty?.SetValue(instance, sanitizedVariableName);

NetworkVariableFields.Add(instance);
}
Expand Down Expand Up @@ -494,7 +498,9 @@ private void NetworkVariableUpdate(ulong clientId, int behaviourIndex)
writer.WriteUInt64Packed(NetworkObjectId);
writer.WriteUInt16Packed(NetworkObject.GetNetworkBehaviourOrderIndex(this));

bool writtenAny = false;
var bufferSizeCapture = new BufferSizeCapture(buffer);

var writtenAny = false;
for (int k = 0; k < NetworkVariableFields.Count; k++)
{
if (!m_ChannelMappedNetworkVariableIndexes[j].Contains(k))
Expand Down Expand Up @@ -559,6 +565,8 @@ private void NetworkVariableUpdate(ulong clientId, int behaviourIndex)
m_NetworkVariableIndexesToResetSet.Add(k);
m_NetworkVariableIndexesToReset.Add(k);
}

NetworkManager.NetworkMetrics.TrackNetworkVariableDeltaSent(clientId, NetworkObjectId, name, NetworkVariableFields[k].Name, bufferSizeCapture.Flush());
}
}

Expand Down Expand Up @@ -655,8 +663,9 @@ internal static void HandleNetworkVariableDeltas(List<INetworkVariable> networkV

networkVariableList[i].ReadDelta(stream, networkManager.IsServer);
PerformanceDataManager.Increment(ProfilerConstants.NetworkVarDeltas);

ProfilerStatManager.NetworkVarsRcvd.Record();
networkManager.NetworkMetrics.TrackNetworkVariableDeltaReceived(clientId, logInstance.NetworkObjectId, logInstance.name, networkVariableList[i].Name, stream.Length);

(stream as NetworkBuffer).SkipPadBits();

if (networkManager.NetworkConfig.EnsureNetworkVariableLengthSafety)
Expand Down Expand Up @@ -741,7 +750,6 @@ internal static void HandleNetworkVariableUpdate(List<INetworkVariable> networkV

networkVariableList[i].ReadField(stream);
PerformanceDataManager.Increment(ProfilerConstants.NetworkVarUpdates);

ProfilerStatManager.NetworkVarsRcvd.Record();

if (networkManager.NetworkConfig.EnsureNetworkVariableLengthSafety)
Expand Down
Loading