# ProfilerCounterDescriptor

> Initializes and returns an instance of ProfilerCounterDescriptor.

## Definition

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

## ProfilerCounterDescriptor(string, ProfilerCategory)

Initializes and returns an instance of [ProfilerCounterDescriptor](/engine/6000.3/script-reference/unity/profiling/editor/profilercounterdescriptor.md).

```csharp
public ProfilerCounterDescriptor(string name, ProfilerCategory category)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the Profiler counter to describe. A string.**** (\[ProfilerCategory]\(/engine/6000.3/script-reference/unity/profiling/profilercategory)): The category of the Profiler counter to describe. A [ProfilerCategory](/engine/6000.3/script-reference/unity/profiling/profilercategory.md).

### Remarks

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

Additional Resources: [ProfilerModule](/engine/6000.3/script-reference/unity/profiling/editor/profilermodule.md).

## ProfilerCounterDescriptor(string, string)

Initializes and returns an instance of [ProfilerCounterDescriptor](/engine/6000.3/script-reference/unity/profiling/editor/profilercounterdescriptor.md).

```csharp
public ProfilerCounterDescriptor(string name, string categoryName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the Profiler counter to describe, as a string.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The category name of the Profiler counter to describe, as a string.

### Remarks

```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.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](/engine/6000.3/script-reference/unity/profiling/editor/profilermodule.md).
