Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ProfilerCounterDescriptor

Initializes and returns an instance of ProfilerCounterDescriptor.
Read time 1 minuteLast updated 12 days ago

Definition

ProfilerCounterDescriptor(string, ProfilerCategory)

Initializes and returns an instance of ProfilerCounterDescriptor.
public ProfilerCounterDescriptor(string name, ProfilerCategory category)

Parameters

name

The name of the Profiler counter to describe. A string.

The category of the Profiler counter to describe. A ProfilerCategory.

Remarks

using System;using Unity.Profiling;using Unity.Profiling.Editor;[Serializable][ProfilerModuleMetadata("Garbage Collection")]public class GarbageCollectionProfilerModule : ProfilerModule{ static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("GC Reserved Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Used Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Allocated In Frame", ProfilerCategory.Memory), }; public GarbageCollectionProfilerModule() : base(k_ChartCounters) {}}
Additional Resources: ProfilerModule.

ProfilerCounterDescriptor(string, string)

Initializes and returns an instance of ProfilerCounterDescriptor.
public ProfilerCounterDescriptor(string name, string categoryName)

Parameters

name

The name of the Profiler counter to describe, as a string.

categoryName

The category name of the Profiler counter to describe, as a string.

Remarks

using System;using Unity.Profiling;using Unity.Profiling.Editor;[Serializable][ProfilerModuleMetadata("Garbage Collection")]public class GarbageCollectionProfilerModule : ProfilerModule{ static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("GC Reserved Memory", ProfilerCategory.Memory.Name), new ProfilerCounterDescriptor("GC Used Memory", ProfilerCategory.Memory.Name), new ProfilerCounterDescriptor("GC Allocated In Frame", ProfilerCategory.Memory.Name), }; public GarbageCollectionProfilerModule() : base(k_ChartCounters) {}}
Additional Resources: ProfilerModule.