A summary of the metrics collected for AsyncReadManager read operations.
Get a summary of the current metrics by calling AsyncReadManagerMetrics.GetCurrentSummaryMetrics. This function summarizes all metrics recorded since you started metrics collection or last cleared your metrics data. Get a summary of an existing set of AsyncReadManagerRequestMetric records by calling AsyncReadManagerMetrics.GetSummaryOfMetrics. You can get these records by calling AsyncReadManagerMetrics.GetMetrics. In both cases, you can filter the data with AsyncReadManagerMetricsFilters in order to focus the summary on the particular categories of data you want to analyze. See Also: AsyncReadManagerMetrics.
using Unity.IO.LowLevel.Unsafe; using UnityEngine;
public class GetMetricsSummary : MonoBehaviour { #if ENABLE_PROFILER && UNITY_2020_2_OR_NEWER AsyncReadManagerMetricsFilters m_Filter; AsyncReadManagerSummaryMetrics m_Summary; public void Start() { // Create a filter for texture file reads that have been completed m_Filter = new AsyncReadManagerMetricsFilters(); m_Filter.SetStateFilter(ProcessingState.Completed); }
public void Update() { m_Summary = AsyncReadManagerMetrics.GetCurrentSummaryMetrics(m_Filter, AsyncReadManagerMetrics.Flags.ClearOnRead); Debug.Log($"Last frame bandwidth: {m_Summary.AverageBandwidthMBPerSecond} MB/s."); }
#endif }
AverageBandwidthMBPerSecond | The mean rate of reading of data (bandwidth), in Mbps, for read request metrics included in the summary calculation. |
AverageReadSizeInBytes | The mean size of data read, in bytes, for read request metrics included in the summary calculation. |
AverageReadTimeMicroseconds | The mean time taken for reading (excluding queue time), in microseconds, for read request metrics included in the summary calculation. |
AverageThroughputMBPerSecond | The mean rate of request throughput, in Mbps, for read request metrics included in the summary calculation. |
AverageTotalRequestTimeMicroseconds | The mean time taken from request to completion, in microseconds, for completed read request metrics included in the summary calculation. |
AverageWaitTimeMicroseconds | The mean time taken from request to the start of reading, in microseconds, for read request metrics included in the summary calculation. |
LongestReadAssetType | The asset type ID for the longest read included in the summary calculation. |
LongestReadSubsystem | The Subsystem tag for the longest read included in the summary calculation. |
LongestReadTimeMicroseconds | The longest read time (not including time in queue) included in the summary calculation in microseconds. |
LongestWaitAssetType | The asset type ID for the longest wait time included in the summary calculation. |
LongestWaitSubsystem | The Subsystem tag for the longest wait time included in the summary calculation. |
LongestWaitTimeMicroseconds | The longest time spent waiting of metrics included in the summary calculation, in microseconds. |
NumberOfAsyncReads | The total number of Async reads in the metrics included in the summary calculation. |
NumberOfCachedReads | The total number of cached reads (so read time was zero) in the metrics included in the summary calculation. |
NumberOfCanceledRequests | The total number of canceled requests in the metrics included in the summary calculation. |
NumberOfCompletedRequests | The total number of completed requests in the metrics included in the summary calculation. |
NumberOfFailedRequests | The total number of failed requests in the metrics included in the summary calculation. |
NumberOfInProgressRequests | The total number of in progress requests in the metrics included in the summary calculation. |
NumberOfSyncReads | The total number of Sync reads in the metrics included in the summary calculation. |
NumberOfWaitingRequests | The total number of waiting requests in the metrics included in the summary calculation. |
TotalBytesRead | The total number of bytes read in the metrics included in the summary calculation. |
TotalNumberOfRequests | The total number of read requests included in the summary calculation. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.