Gather metrics
Gather metrics to monitor performance and identify potential issues in your Netcode for Entities project.
There are two ways to gather metrics in Netcode for Entities:
- Use the Network Debugger tool by selecting Window > Multiplayer > Network Debugger in the Editor. This provides you with a simple web interface to view metrics.
- Create a
GhostMetricsMonitorComponentsingleton and populate it with the data points you want to monitor. This allows you to access the metrics programmatically and use them in your project logic or for custom monitoring solutions.
The following example creates a singleton containing all available data metrics.
Adding the respective IComponentData to the singleton enables the collection of that metrics type.
Warning
It looks like the sample you are looking for does not exist.
Use SystemAPI.GetSingleton to access data metrics for a specific metrics type. For example, to access the NetworkMetrics:
Warning
It looks like the sample you are looking for does not exist.
Available metrics
| Component | Description |
|---|---|
NetworkMetrics |
Network and time related metrics. |
SnapshotMetrics |
Snapshot related metrics. |
GhostMetrics |
Ghost related metrics indexed using GhostNames. |
GhostSerializationMetrics |
Ghost serialization metrics indexed using GhostNames. |
PredictionErrorMetrics |
Prediction errors indexed using PredictionErrorNames. |
GhostNames |
A list of all available ghosts for this simulation. |
PredictionErrorNames |
A list of all available prediction errors for this simulation. |