# Custom Profiler Stats

**URL:** <https://forums.unrealengine.com/t/custom-profiler-stats/303745>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** stats, profiler, unreal-engine, CPP, question\
**Created:** [January 12, 2015, 7:30pm UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745 "2015-01-12T19:30:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucasncv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lucasncv](https://forums.unrealengine.com/u/lucasncv)\
**Post date:** [January 12, 2015, 7:30pm UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745/1 "2015-01-12T19:30:39Z")

</div>

Is it possible to create custom stats that can be tracked by the Profiler? I’ve tried the following at the top of a cpp file.

```
DECLARE_STATS_GROUP(TEXT("Homebrew"), STATGROUP_Homebrew, STATCAT_Advanced);
DECLARE_CYCLE_STAT(TEXT("Detect Position"), STAT_DetectPosition, STATGROUP_Homebrew);

```

It builds fine but the Profiler doesn’t show my stat group. Even if I use a group that already exists it still doesn’t show my stat.

I’m also using SCOPE\_CYCLE\_COUNTER(STAT\_DetectPosition) in a function.

---

<div class="post-metadata">

**Author:** ![Anshul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anshul](https://forums.unrealengine.com/u/Anshul)\
**Post date:** [March 1, 2015, 4:56am UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745/2 "2015-03-01T04:56:48Z")

</div>

I have the following in my .h file

```
DECLARE_STATS_GROUP(TEXT("BulletPool"), STATGROUP_BulletPool, STATCAT_Advanced);
DECLARE_CYCLE_STAT_EXTERN(TEXT("RequestBulletTypeFromPool"), STAT_RequestBulletTypeFromPool, STATGROUP_BulletPool, SHOTGUNHADES_API);
DECLARE_CYCLE_STAT_EXTERN(TEXT("ReturnBulletTypeToPool"), STAT_ReturnBulletTypeToPool, STATGROUP_BulletPool, SHOTGUNHADES_API);

```

I have the following in my .cpp file

```
DEFINE_STAT(STAT_RequestBulletTypeFromPool);
DEFINE_STAT(STAT_ReturnBulletTypeToPool);

```

And the following inside the function

```
SCOPE_CYCLE_COUNTER(STAT_RequestBulletTypeFromPool);

```

It seems to work for me and I can see my stats and the group in Session Frontend window. Hope this helps in resolving your problem!

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [January 22, 2016, 1:09am UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745/3 "2016-01-22T01:09:30Z")

</div>

^^^^

Should be promoted to Answer. Solved my Linkage problem with stats.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [January 22, 2016, 2:26am UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745/4 "2016-01-22T02:26:55Z")

</div>

At your service

---

<div class="post-metadata">

**Author:** ![TimLobner](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TimLobner](https://forums.unrealengine.com/u/TimLobner)\
**Post date:** [August 25, 2020, 12:36pm UTC](https://forums.unrealengine.com/t/custom-profiler-stats/303745/5 "2020-08-25T12:36:15Z")

</div>

is it possible to view this in the editor with a stat command, or is this just part of the profiler?
