Photon Unity Networking
v1.88
|
The PhotonStatsGui is a simple GUI component to track and show network-metrics at runtime.
Usage
Just add the PhotonStatsGui component to any active GameObject in the hierarchy. A window appears (at runtime) and shows the message count.
A few toggles let you configure the window:
- buttons: Show buttons for "stats on", "reset stats" and "to log"
- traffic: Show lower level network traffic (bytes per direction)
- health: Show timing of sending, dispatches and their longest gaps
Message Statistics
The top most values showns are counter for "messages". Any operation, response and event are counted. Shown are the total count of outgoing, incoming and the sum of those messages as total and as average for the timespan that is tracked.
Traffic Statistics
These are the byte and packet counters. Anything that leaves or arrives via network is counted here. Even if there are few messages, they could be huge by accident and still cause less powerful clients to drop connection. You also see that there are packages sent when you don't send messages. They keeps the connection alive.
Health Statistics
The block beginning with "longest delta between" is about the performance of your client. We measure how much time passed between consecutive calls of send and dispatch. Usually they should be called ten times per second. If these values go beyond one second, you should check why Update() calls are delayed.
Button "Reset"
This resets the stats but keeps tracking them. This is useful to track message counts for different situations.
Button "To Log"
Pressing this simply logs the current stat values. This can be useful to have a overview how things evolved or just as reference.
Button "Stats On" (Enabling Traffic Stats)
The Photon library can track various network statistics but usually this feature is turned off. The PhotonStatsGui will enable the tracking and show those values.
The "stats on" toggle in the Gui controls if traffic stats are collected at all. The "Traffic Stats On" checkbox in the Inspector is the same value.