# HierarchyFrameDataView

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

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.Profiling](/engine/6000.6/script-reference/unityeditor/profiling.md)
* **Assembly:** UnityEditor.CoreModule
* **Inherits from:** [FrameDataView](/engine/6000.6/script-reference/unityeditor/profiling/framedataview.md)
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class HierarchyFrameDataView : FrameDataView, IDisposable
```

## Remarks

Use *HierarchyFrameDataView* to retrieve Profiler samples structured as a hierarchy.

This is used in the **Hierachy mode** of the [CPU Usage Profiler](/engine/6000.6/manual/analysis/profiler/visualizing-data/cpu.md), for example.

The *HierarchyFrameDataView* aggregates the data with time and memory information. Each hierarchy item includes accumulated data of its children.

## Examples

```csharp
using System;
using System.Collections.Generic;
using UnityEditor.Profiling;
using UnityEditorInternal;

public class Example
{
    List<int> parentsCacheList = new List<int>();
    List<int> childrenCacheList = new List<int>();

    public void ProcessFrameData(int frame)
    {
        using (var frameData = ProfilerDriver.GetHierarchyFrameDataView(frame, 0, HierarchyFrameDataView.ViewModes.Default, HierarchyFrameDataView.columnGcMemory, false))
        {
            int rootId = frameData.GetRootItemID();
            frameData.GetItemDescendantsThatHaveChildren(rootId, parentsCacheList);
            foreach (int parentId in parentsCacheList)
            {
                frameData.GetItemChildren(parentId, childrenCacheList);
                // Process further records
            }
        }
    }
}
```

## Static Fields

| Value                                                                                                                    | Description                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| [columnCalls](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columncalls.md)               | The Calls column.                                                                                         |
| [columnDontSort](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columndontsort.md)         | The column identifier that indicates whether sorting is disabled.                                         |
| [columnGcMemory](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columngcmemory.md)         | The amount of managed allocations within a sample.                                                        |
| [columnName](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnname.md)                 | The Profiler Sample Name column.                                                                          |
| [columnObjectName](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnobjectname.md)     | The Object Name column.                                                                                   |
| [columnSelfPercent](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnselfpercent.md)   | The percentage of the CPU time Unity spends in a sample itself, excluding the time from child samples.    |
| [columnSelfTime](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnselftime.md)         | The CPU time in milliseconds that Unity spends in a sample itself, excluding the time from child samples. |
| [columnStartTime](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnstarttime.md)       | The start time of a call in milliseconds.                                                                 |
| [columnTotalPercent](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columntotalpercent.md) | The percentage of the CPU time Unity spends in a sample, including the time from child samples.           |
| [columnTotalTime](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columntotaltime.md)       | The CPU time in milliseconds that Unity spends in a sample, including the time from child samples.        |
| [columnWarningCount](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/columnwarningcount.md) | The amount of samples that are inside a code execution path that is suboptimal for performance.           |
| [invalidSampleId](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/invalidsampleid.md)       | Index of the invalid item.                                                                                |

## Properties

| Property                                                                                                                   | Description                                                         |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [sortColumn](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/sortcolumn.md)                   | The column identifier that defines the sort column.                 |
| [sortColumnAscending](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/sortcolumnascending.md) | Whether the sorting order is ascending, true, or descending, false. |
| [viewMode](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/viewmode.md)                       | The view mode which defines how data is aggregated.                 |

## Methods

| Method                                                                                                                                                             | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [GetItemAncestors](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemancestors.md)                                               | Retrieves a list of hierarchy item ancestors.                                                                                             |
| [GetItemCallstack](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcallstack.md)                                               | Gets the callstack associated with the specified hierarchy item.                                                                          |
| [GetItemCategoryIndex](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcategoryindex.md)                                       | Gets Profiler marker category for the specific marker identifier.                                                                         |
| [GetItemChildren](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemchildren.md)                                                 | Retrieves a list of hierarchy item children.                                                                                              |
| [GetItemColumnData](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcolumndata.md)                                             | Returns string representation of hierarchy item value associated with the column.                                                         |
| [GetItemColumnDataAsDouble](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcolumndataasdouble.md)                             | Returns double representation of hierarchy item value associated with the column.                                                         |
| [GetItemColumnDataAsFloat](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcolumndataasfloat.md)                               | Returns float representation of hierarchy item value associated with the column.                                                          |
| [GetItemColumnDataAsSingle](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemcolumndataassingle.md)                             | Returns float representation of hierarchy item value associated with the column.                                                          |
| [GetItemDepth](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemdepth.md)                                                       | Returns hierarchy level of the item.                                                                                                      |
| [GetItemDescendantsThatHaveChildren](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemdescendantsthathavechildren.md)           | Use to retrieve a list of a hierarchy item descendants which have other children.                                                         |
| [GetItemEntityId](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitementityid.md)                                                 | Returns EntityId of the UnityEngine.Object associated with the sample.                                                                    |
| [GetItemMarkerFlags](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmarkerflags.md)                                           | Use to retrieve a marker usage flags.                                                                                                     |
| [GetItemMarkerID](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmarkerid.md)                                                 | Returns Profiler marker which uniquely identifies sample name.                                                                            |
| [GetItemMarkerIDPath](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmarkeridpath.md)                                         | Use to retrieve a list of a marker identifiers of all hierarchy item parents.                                                             |
| [GetItemMergedSampleCallstack](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplecallstack.md)                       | Gets the callstack associated with the specified hierarchy item.                                                                          |
| [GetItemMergedSamplesColumnData](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplescolumndata.md)                   | Use to retrieve a values of merged samples of a hierarchy item.                                                                           |
| [GetItemMergedSamplesColumnDataAsDoubles](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplescolumndataasdoubles.md) | Retrieves the merged samples for a specific hierarchy item. Merged samples are returned as a list of doubles through the outValues param. |
| [GetItemMergedSamplesColumnDataAsFloats](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplescolumndataasfloats.md)   | Retrieves the merged samples for a specific hierarchy item. Merged samples are returned as a list of floats through the outValues param.  |
| [GetItemMergedSamplesCount](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplescount.md)                             | Return merged samples count represented by the hierarchy item.                                                                            |
| [GetItemMergedSamplesEntityId](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplesentityid.md)                       | Retrieves the EntityId of the merged samples corresponding to a hierarchy item.                                                           |
| [GetItemMergedSamplesMetadata](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplesmetadata.md)                       | Returns string representation of hierarchy item metadata value.                                                                           |
| [GetItemMergedSamplesMetadataAsFloat](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplesmetadataasfloat.md)         | Returns float representation of hierarchy item metadata value.                                                                            |
| [GetItemMergedSamplesMetadataAsLong](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplesmetadataaslong.md)           | Returns long representation of hierarchy item metadata value.                                                                             |
| [GetItemMergedSamplesMetadataCount](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmergedsamplesmetadatacount.md)             | Returns metadata count associated with hierarchy item.                                                                                    |
| [GetItemMetadata](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmetadata.md)                                                 | Returns string representation of hierarchy item metadata value.                                                                           |
| [GetItemMetadataAsFloat](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmetadataasfloat.md)                                   | Returns float representation of hierarchy item metadata value.                                                                            |
| [GetItemMetadataAsLong](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmetadataaslong.md)                                     | Returns long representation of hierarchy item metadata value.                                                                             |
| [GetItemMetadataCount](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemmetadatacount.md)                                       | Returns metadata count associated with hierarchy item.                                                                                    |
| [GetItemName](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemname.md)                                                         | Gets the sample name associated with the item.                                                                                            |
| [GetItemPath](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitempath.md)                                                         | Retrieves the hierarchy item path as a string. Each level is delimited by forward slashes ('/').                                          |
| [GetItemRawFrameDataViewIndices](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getitemrawframedataviewindices.md)                   | Retrieves the raw indices of all samples associated with this Hierarchy item identifier.                                                  |
| [GetRootItemID](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/getrootitemid.md)                                                     | Gets the identifier for the root tree item.                                                                                               |
| [HasItemChildren](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/hasitemchildren.md)                                                 | Checks whether the tree item has children.                                                                                                |
| [ItemContainsRawFrameDataViewIndex](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/itemcontainsrawframedataviewindex.md)             | Checks if the provided raw sample index matches any of the raw sample indices associated with this Hierarchy item identifier.             |
| [ResolveItemCallstack](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/resolveitemcallstack.md)                                       | Gets the callstack associated with the specified hierarchy item.                                                                          |
| [ResolveItemMergedSampleCallstack](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/resolveitemmergedsamplecallstack.md)               | Gets the callstack associated with a specific item sample.                                                                                |
| [Sort](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/sort.md)                                                                       | Sorts the hierarchy view.                                                                                                                 |

## Enums

| Enum                                                                                                                          | Description                                        |
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [HierarchyFrameDataView.ViewModes](/engine/6000.6/script-reference/unityeditor/profiling/hierarchyframedataview/viewmodes.md) | The ViewModes enum defines data aggregation rules. |

## Inheritance

**Inherited Members:**

* [FrameDataView.invalidMarkerId](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/invalidmarkerid.md)
* [FrameDataView.invalidThreadIndex](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/invalidthreadindex.md)
* [FrameDataView.invalidThreadId](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/invalidthreadid.md)
* [FrameDataView.GetMarkerCategoryIndex(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkercategoryindex.md)
* [FrameDataView.GetMarkerFlags(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkerflags.md)
* [FrameDataView.GetMarkerName(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkername.md)
* [FrameDataView.GetMarkerMetadataInfo(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkermetadatainfo.md)
* [FrameDataView.GetMarkerId(string)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkerid.md)
* [FrameDataView.GetMarkers(List\<MarkerInfo>)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getmarkers.md)
* [FrameDataView.GetCategoryInfo(ushort)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcategoryinfo.md)
* [FrameDataView.GetAllCategories(List\<ProfilerCategoryInfo>)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getallcategories.md)
* [FrameDataView.GetFrameMetaData\<T>(Guid, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getframemetadata.md#getframemetadatat\(guid-int\))
* [FrameDataView.GetFrameMetaData\<T>(Guid, int, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getframemetadata.md#getframemetadatat\(guid-int-int\))
* [FrameDataView.GetFrameMetaDataCount(Guid, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getframemetadatacount.md)
* [FrameDataView.GetSessionMetaData\<T>(Guid, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getsessionmetadata.md#getsessionmetadatat\(guid-int\))
* [FrameDataView.GetSessionMetaData\<T>(Guid, int, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getsessionmetadata.md#getsessionmetadatat\(guid-int-int\))
* [FrameDataView.GetSessionMetaDataCount(Guid, int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getsessionmetadatacount.md)
* [FrameDataView.ResolveMethodInfo(ulong)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/resolvemethodinfo.md)
* [FrameDataView.GetCounterValuePtr(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcountervalueptr.md)
* [FrameDataView.HasCounterValue(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/hascountervalue.md)
* [FrameDataView.GetCounterValueAsInt(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcountervalueasint.md)
* [FrameDataView.GetCounterValueAsLong(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcountervalueaslong.md)
* [FrameDataView.GetCounterValueAsFloat(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcountervalueasfloat.md)
* [FrameDataView.GetCounterValueAsDouble(int)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getcountervalueasdouble.md)
* [FrameDataView.GetUnityObjectInfo(EntityId, UnityObjectInfo)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getunityobjectinfo.md#getunityobjectinfo\(entityid-unityobjectinfo\))
* [FrameDataView.GetUnityObjectNativeTypeInfo(int, UnityObjectNativeTypeInfo)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getunityobjectnativetypeinfo.md)
* [FrameDataView.GetUnityObjectNativeTypeInfoCount()](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getunityobjectnativetypeinfocount.md)
* [FrameDataView.GetGfxResourceInfo(ulong, GfxResourceInfo)](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/getgfxresourceinfo.md)
* [FrameDataView.valid](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/valid.md)
* [FrameDataView.frameIndex](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/frameindex.md)
* [FrameDataView.threadIndex](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/threadindex.md)
* [FrameDataView.threadGroupName](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/threadgroupname.md)
* [FrameDataView.threadName](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/threadname.md)
* [FrameDataView.threadId](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/threadid.md)
* [FrameDataView.frameStartTimeMs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/framestarttimems.md)
* [FrameDataView.frameStartTimeNs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/framestarttimens.md)
* [FrameDataView.frameTimeMs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/frametimems.md)
* [FrameDataView.frameTimeNs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/frametimens.md)
* [FrameDataView.frameGpuTimeMs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/framegputimems.md)
* [FrameDataView.frameGpuTimeNs](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/framegputimens.md)
* [FrameDataView.frameFps](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/framefps.md)
* [FrameDataView.sampleCount](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/samplecount.md)
* [FrameDataView.maxDepth](/engine/6000.6/script-reference/unityeditor/profiling/framedataview/maxdepth.md)
