Version: 2022.3
LanguageEnglish
  • C#

AsyncReadManagerSummaryMetrics

class in Unity.IO.LowLevel.Unsafe

/

Implemented in:UnityEngine.CoreModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

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. Additional resources: 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 }

Properties

AverageBandwidthMBPerSecondThe mean rate of reading of data (bandwidth), in Mbps, for read request metrics included in the summary calculation.
AverageReadSizeInBytesThe mean size of data read, in bytes, for read request metrics included in the summary calculation.
AverageReadTimeMicrosecondsThe mean time taken for reading (excluding queue time), in microseconds, for read request metrics included in the summary calculation.
AverageThroughputMBPerSecondThe mean rate of request throughput, in Mbps, for read request metrics included in the summary calculation.
AverageTotalRequestTimeMicrosecondsThe mean time taken from request to completion, in microseconds, for completed read request metrics included in the summary calculation.
AverageWaitTimeMicrosecondsThe mean time taken from request to the start of reading, in microseconds, for read request metrics included in the summary calculation.
LongestReadAssetTypeThe asset type ID for the longest read included in the summary calculation.
LongestReadSubsystemThe Subsystem tag for the longest read included in the summary calculation.
LongestReadTimeMicrosecondsThe longest read time (not including time in queue) included in the summary calculation in microseconds.
LongestWaitAssetTypeThe asset type ID for the longest wait time included in the summary calculation.
LongestWaitSubsystemThe Subsystem tag for the longest wait time included in the summary calculation.
LongestWaitTimeMicrosecondsThe longest time spent waiting of metrics included in the summary calculation, in microseconds.
NumberOfAsyncReadsThe total number of Async reads in the metrics included in the summary calculation.
NumberOfCachedReadsThe total number of cached reads (so read time was zero) in the metrics included in the summary calculation.
NumberOfCanceledRequestsThe total number of canceled requests in the metrics included in the summary calculation.
NumberOfCompletedRequestsThe total number of completed requests in the metrics included in the summary calculation.
NumberOfFailedRequestsThe total number of failed requests in the metrics included in the summary calculation.
NumberOfInProgressRequestsThe total number of in progress requests in the metrics included in the summary calculation.
NumberOfSyncReadsThe total number of Sync reads in the metrics included in the summary calculation.
NumberOfWaitingRequestsThe total number of waiting requests in the metrics included in the summary calculation.
TotalBytesReadThe total number of bytes read in the metrics included in the summary calculation.
TotalNumberOfRequestsThe total number of read requests included in the summary calculation.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961