Skip to content

Commit f9155ef

Browse files
committed
Update sample
1 parent 60e6702 commit f9155ef

File tree

1 file changed

+15
-5
lines changed
  • platform-includes/performance/traces-sampler-as-sampler

1 file changed

+15
-5
lines changed

platform-includes/performance/traces-sampler-as-sampler/unreal.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,27 @@ class USomeTraceSampler : public USentryTraceSampler
77
public:
88
virtual bool Sample_Implementation(USentrySamplingContext* samplingContext, float& samplingValue) override
99
{
10-
const FString& path =
11-
*samplingContext->GetCustomSamplingContext().Find("__HttpPath");
10+
const FString& gameMode =
11+
*samplingContext->GetCustomSamplingContext().Find("GameMode");
1212

13-
if (path.Equals(TEXT("/payment")))
13+
if (gameMode.Equals(TEXT("ranked")))
1414
{
15-
// These are important - take a big sample
15+
// Ranked matches are important - take a big sample
1616
samplingValue = 0.5;
1717
}
18+
else if (gameMode.Equals(TEXT("quick_match")))
19+
{
20+
// Quick matches less important and happen more frequently - only take 20%
21+
samplingValue = 0.2;
22+
}
23+
else if (gameMode.Equals(TEXT("training")))
24+
{
25+
// Training matches are just noise - drop all transactions
26+
samplingValue = 0.0;
27+
}
1828
else
1929
{
20-
// Default sample rate
30+
// Default sample rate for other game modes
2131
samplingValue = 0.1;
2232
}
2333

0 commit comments

Comments
 (0)