View internal statistics related to the Best HTTP/2 plugin, integrated into the Unity Profiler window.
Steps to install and setup:
-
The profiler addon has a dependency on the com.unity.profiling.core that requires Unity 2021.2 or newer installations.
-
Make sure that the Best HTTP/2 package is already installed.
-
Using the Package Manager window install the package from the following git source: https://github.com/Benedicht/com.besthttp.profiler.git:
-
Create a new GameObject in your scene and add the DataCollector component:
📝 Note: DataCollector will call Object.DontDestroyOnLoad on the GameObject it's placed on!
Collected fields:
- Sent: Sent bytes since the previous frame.
- Sent Total: Total bytes sent by the plugin.
- Received: Received bytes since the previous frame.
- Received Total: Total bytes received.
- Open Connections: Currently open connections. An open connection might be an idle connection that have no active request/response to process.
- Total Connections: Total connections, including open ones too.
📝 Note: Communication with a proxy isn't tracked by the Network Profiler until it's connected. This means that while it tries to connect it doesn't show up in
Open Connections
andTotal Connections
, negotiation request and response doesn't registered inSent
/Sent Total
/Received
/Received Total
.
Collected fields:
- Borrowed: Borrowed memory from the BufferPool.
- Pooled: Memory in the BufferPool available to borrow.
- Array Allocations: Total number of
byte[]
allocations through the BufferPool. An allocation occurs when there's no suitablebyte[]
in the pool to borrow. If it's constantly growing, increasing BufferPool.MaxPoolSize might be a good idea.
📝 Note: In case of errors memory might not be placed back to the pool and will be displayed as borrowed indefinitely. It doesn't mean there's a memory leak, just that it doesn't placed back to the BufferPool.
There are two ways to collect data for the profiler. The first one is to use the DataCollector
component attached to a GameObject.
The seconds method is to use the ProfilerUpdater
directly from code. ProfilerUpdater.Attach()
can be used to start collecting, its best place is somewhere in a startup code before any other plugin releated calls. ProfilerUpdater.Detach()
can be used to stop data collection.