# ProfilerModule

> Represents a Profiler module in the Profiler window.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Profiling.Editor](/engine/6000.5/script-reference/unity/profiling/editor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public abstract class ProfilerModule
```

## Remarks

Use ProfilerModule to extend the Profiler window with custom Profiler modules. You can use ProfilerModule with the [Profiling Core package](https://docs.unity3d.com/Packages/com.unity.profiling.core@latest), to expose and visualize performance metrics for your own systems in the Profiler window.

To define a [ProfilerModule](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule.md) derived type, use an [Editor script](/engine/6000.5/manual/get-started/project-configuration/special-folders.md) inside your project or package and attribute it with the [ProfilerModuleMetadataAttribute](/engine/6000.5/script-reference/unity/profiling/editor/profilermodulemetadataattribute.md). At a minimum, you must define the Profiler module’s name and chart counters, as shown below. The Profiler window automatically displays any [ProfilerModule](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule.md) derived types present in your project.

```csharp
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) { }
}
```

When a Profiler module is selected in the Profiler window, Unity displays the module's **Details View**, which contains additional, relevant performance data. By default, a module’s **Details View** displays a list of its chart’s counters alongside their current values in the selected frame. You can implement a custom **Details View** to present a bespoke visualization of your performance data when the module is selected. For more information, see [ProfilerModule.CreateDetailsViewController](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule/createdetailsviewcontroller.md).

Additional Resources: [ProfilerModuleMetadataAttribute](/engine/6000.5/script-reference/unity/profiling/editor/profilermodulemetadataattribute.md), [ProfilerCounterDescriptor](/engine/6000.5/script-reference/unity/profiling/editor/profilercounterdescriptor.md), [ProfilerModuleChartType](/engine/6000.5/script-reference/unity/profiling/editor/profilermodulecharttype.md), [ProfilerModuleViewController](/engine/6000.5/script-reference/unity/profiling/editor/profilermoduleviewcontroller.md).

## Constructors

| Constructor                                                                                                                                                                                                            | Description                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [ProfilerModule(Unity.Profiling.Editor.ProfilerCounterDescriptor\[\],Unity.Profiling.Editor.ProfilerModuleChartType,System.String\[\])](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule/ctor.md) | Initializes and returns an instance of [ProfilerModule](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule.md). |

## Properties

| Property                                                                                                  | Description                                              |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [DisplayName](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule/displayname.md)       | The module’s display name.                               |
| [ProfilerWindow](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule/profilerwindow.md) | The Profiler window that the module instance belongs to. |

## Methods

| Method                                                                                                                              | Description                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [CreateDetailsViewController](/engine/6000.5/script-reference/unity/profiling/editor/profilermodule/createdetailsviewcontroller.md) | Creates a View Controller object that draws the Profiler module’s Details View in the Profiler window. Unity calls this method automatically when the module is selected in the Profiler window. |
