Skip to content

Commit 719ab6c

Browse files
authored
[Profiler] New scenario: Add endpoint with dots (#3756)
1 parent db7874a commit 719ab6c

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// <copyright file="EndpointsCountController.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
4+
// </copyright>
5+
6+
using System;
7+
using System.Threading.Tasks;
8+
using Microsoft.AspNetCore.Mvc;
9+
10+
namespace BuggyBits.Controllers
11+
{
12+
public class EndpointsCountController : Controller
13+
{
14+
[Route("End.Point.With.Dots")]
15+
public async Task<IActionResult> Index()
16+
{
17+
await Task.Delay(TimeSpan.FromSeconds(1));
18+
19+
return Redirect("/");
20+
}
21+
}
22+
}

profiler/src/Demos/Samples.BuggyBits/Controllers/ReviewsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="ReviewsController.cs" company="Datadog">
1+
// <copyright file="ReviewsController.cs" company="Datadog">
22
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
44
// </copyright>

profiler/src/Demos/Samples.BuggyBits/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public enum Scenario
2323
Async = 8, // using async code
2424
FormatExceptions = 16, // generating FormatExceptions for prices
2525
ParallelLock = 32, // using parallel code with lock
26-
MemoryLeak = 64 // keep a controller in memory due to instance callback passed to a cache
26+
MemoryLeak = 64, // keep a controller in memory due to instance callback passed to a cache
27+
EndpointsCount = 128 // Specific test with '.' in endpoint name
2728
}
2829

2930
public class Program

profiler/src/Demos/Samples.BuggyBits/SelfInvoker.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ private List<string> GetEndpoints(string rootUrl)
133133
{
134134
urls.Add($"{rootUrl}/News");
135135
}
136+
137+
if ((_scenario & Scenario.EndpointsCount) == Scenario.EndpointsCount)
138+
{
139+
urls.Add($"{rootUrl}/End.Point.With.Dots");
140+
}
136141
}
137142

138143
return urls;

0 commit comments

Comments
 (0)