A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.unity3d.com/Manual/../ScriptReference/Profiling.RawFrameDataView.html below:

Unity - Scripting API: RawFrameDataView

RawFrameDataView

class in UnityEditor.Profiling

/

Inherits from:Profiling.FrameDataView

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 Your name Your email Suggestion*

Cancel

Description

Provides access to the Profiler data for a specific frame and thread.

Use RawFrameDataView to retrieve unstructured Profiler samples data for the particular frame.
The order of samples is determined by the order they are generated in the code.

RawFrameDataView can quickly iterate over all samples in the frame without any internal allocations.

using System;
using Unity.Collections;
using UnityEditor.Profiling;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Profiling;

public class Example { public static long GetGCAllocs(int frameIndex) { long totalGcAllocSize = 0;

int gcAllocMarkerId = FrameDataView.invalidMarkerId;

for (int threadIndex = 0;; ++threadIndex) { using (RawFrameDataView frameData = ProfilerDriver.GetRawFrameDataView(frameIndex, threadIndex)) { if (!frameData.valid) break;

if (gcAllocMarkerId == FrameDataView.invalidMarkerId) { gcAllocMarkerId = frameData.GetMarkerId("GC.Alloc"); if (gcAllocMarkerId == FrameDataView.invalidMarkerId) break; }

int sampleCount = frameData.sampleCount; for (int i = 0; i < sampleCount; ++i) { if (gcAllocMarkerId != frameData.GetSampleMarkerId(i)) continue;

long gcAllocSize = frameData.GetSampleMetadataAsLong(i, 0); totalGcAllocSize += gcAllocSize; } } }

return totalGcAllocSize; } }

Additional resources: FrameDataView, HierarchyFrameDataView.

Static Properties Property Description invalidSampleIndex This constant defines a sample index that does not match any valid Profiler Sample. Inherited Members Static Properties Property Description invalidMarkerId Identifier of the invalid marker. invalidThreadId This constant defines a thread id that does not match any valid thread's id. invalidThreadIndex This constant defines a thread index that does not match any valid thread's index. Properties Property Description frameFps The current frames per second (FPS) for the frame. frameGpuTimeMs The amount of GPU frame time in milliseconds. frameGpuTimeNs The amount of GPU frame time in nanoseconds. frameIndex The frame index for the FrameDataView. frameStartTimeMs The start time of CPU frame in milliseconds. frameStartTimeNs The start time of CPU frame in nanoseconds. frameTimeMs The amount of CPU frame time in milliseconds. frameTimeNs The amount of CPU frame time in nanoseconds. maxDepth Maximum child samples levels in the thread data. sampleCount The amount of samples in the frame for the thread. threadGroupName The name of the group that the thread belongs to. threadId Persistent identifier associated with the thread. threadIndex The index of the thread in the current frame. threadName Name of the thread. valid True after the frame data for the thread is processed and ready for retrieval.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4