Skip to content

Commit 9002371

Browse files
committed
Remove MiniProfiler
1 parent 5a57f29 commit 9002371

File tree

14 files changed

+0
-234
lines changed

14 files changed

+0
-234
lines changed

src/Monolith/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="9.0.1" />
4040
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="9.0.1" />
4141
<PackageReference Include="Microsoft.Graph" Version="5.68.0" />
42-
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.5.4" />
43-
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.5.4" />
44-
<PackageReference Include="MiniProfiler.Providers.SqlServer" Version="4.5.4" />
4542
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.0" />
4643
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.11.0" />
4744
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.0" />

src/Monolith/ClassifiedAds.Infrastructure/Monitoring/MiniProfiler/MiniProfilerOptions.cs

-19
This file was deleted.

src/Monolith/ClassifiedAds.Infrastructure/Monitoring/MiniProfiler/MiniProfilerServiceCollectionExtensions.cs

-49
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using ClassifiedAds.Infrastructure.Monitoring.AzureApplicationInsights;
2-
using ClassifiedAds.Infrastructure.Monitoring.MiniProfiler;
32
using ClassifiedAds.Infrastructure.Monitoring.OpenTelemetry;
4-
using Microsoft.AspNetCore.Builder;
53
using Microsoft.Extensions.DependencyInjection;
64

75
namespace ClassifiedAds.Infrastructure.Monitoring;
@@ -10,11 +8,6 @@ public static class MonitoringExtensions
108
{
119
public static IServiceCollection AddMonitoringServices(this IServiceCollection services, MonitoringOptions monitoringOptions = null)
1210
{
13-
if (monitoringOptions?.MiniProfiler?.IsEnabled ?? false)
14-
{
15-
services.AddMiniProfiler(monitoringOptions.MiniProfiler);
16-
}
17-
1811
if (monitoringOptions?.AzureApplicationInsights?.IsEnabled ?? false)
1912
{
2013
services.AddAzureApplicationInsights(monitoringOptions.AzureApplicationInsights);
@@ -27,14 +20,4 @@ public static IServiceCollection AddMonitoringServices(this IServiceCollection s
2720

2821
return services;
2922
}
30-
31-
public static IApplicationBuilder UseMonitoringServices(this IApplicationBuilder builder, MonitoringOptions monitoringOptions)
32-
{
33-
if (monitoringOptions?.MiniProfiler?.IsEnabled ?? false)
34-
{
35-
builder.UseMiniProfiler();
36-
}
37-
38-
return builder;
39-
}
4023
}

src/Monolith/ClassifiedAds.Infrastructure/Monitoring/MonitoringOptions.cs

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
using ClassifiedAds.Infrastructure.Monitoring.AzureApplicationInsights;
2-
using ClassifiedAds.Infrastructure.Monitoring.MiniProfiler;
32
using ClassifiedAds.Infrastructure.Monitoring.OpenTelemetry;
43

54
namespace ClassifiedAds.Infrastructure.Monitoring;
65

76
public class MonitoringOptions
87
{
9-
public MiniProfilerOptions MiniProfiler { get; set; }
10-
118
public AzureApplicationInsightsOptions AzureApplicationInsights { get; set; }
129

1310
public OpenTelemetryOptions OpenTelemetry { get; set; }

src/Monolith/ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<EmbeddedResource Include="DbUp\MiniProfiler\0001-CreateTables.sql" />
1211
<EmbeddedResource Include="DbUp\SqlServerDistributedCache\0001-CreateTables.sql" />
1312
</ItemGroup>
1413

src/Monolith/ClassifiedAds.Migrator/DbUp/MiniProfiler/0001-CreateTables.sql

-69
This file was deleted.

src/Monolith/ClassifiedAds.WebAPI/Program.cs

-2
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@
299299

300300
app.UseRateLimiter();
301301

302-
app.UseMonitoringServices(appSettings.Monitoring);
303-
304302
app.UseHealthChecks("/healthz", new HealthCheckOptions
305303
{
306304
Predicate = _ => true,

src/Monolith/ClassifiedAds.WebAPI/appsettings.json

-9
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,6 @@
7171
}
7272
},
7373
"Monitoring": {
74-
"MiniProfiler": {
75-
"IsEnabled": true
76-
//"SqlServerStorage": {
77-
// "ConectionString": "Server=127.0.0.1;Database=ClassifiedAds;User Id=sa;Password=sqladmin123!@#;MultipleActiveResultSets=true",
78-
// "ProfilersTable": "MiniProfilers",
79-
// "TimingsTable": "MiniProfilerTimings",
80-
// "ClientTimingsTable": "MiniProfilerClientTimings"
81-
//}
82-
},
8374
"AzureApplicationInsights": {
8475
"IsEnabled": false,
8576
"InstrumentationKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",

src/Monolith/ClassifiedAds.WebMVC/HttpMessageHandlers/ProfilingHttpHandler.cs

-47
This file was deleted.

src/Monolith/ClassifiedAds.WebMVC/Program.cs

-4
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@
130130
})
131131
.AddSingleton<IAuthorizationHandler, CustomRequirementHandler>();
132132

133-
services.AddTransient<ProfilingHttpHandler>();
134133
services.AddTransient<BearerTokenHandler>();
135134
services.AddHttpClient(string.Empty)
136-
.AddHttpMessageHandler<ProfilingHttpHandler>()
137135
.AddHttpMessageHandler<BearerTokenHandler>();
138136

139137
services.AddCaches(appSettings.Caching);
@@ -196,8 +194,6 @@
196194
app.UseAuthentication();
197195
app.UseAuthorization();
198196

199-
app.UseMonitoringServices(appSettings.Monitoring);
200-
201197
app.UseHealthChecks("/healthz", new HealthCheckOptions
202198
{
203199
Predicate = _ => true,

src/Monolith/ClassifiedAds.WebMVC/Views/Shared/_Layout.cshtml

-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<a class="nav-link text-dark" href="/healthz">Health Checks</a>
6565
</li>
6666
</feature>
67-
<li class="nav-item">
68-
<a class="nav-link text-dark" href="@appSettings.Value.ResourceServer.PublicEndpoint/profiler/results">API</a>
69-
</li>
7067
</ul>
7168
</div>
7269
</div>
@@ -84,7 +81,6 @@
8481
&copy; 2020 - ClassifiedAds.WebMVC - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
8582
</div>
8683
</footer>
87-
<mini-profiler />
8884
<environment include="Development">
8985
<script src="~/lib/jquery/dist/jquery.js"></script>
9086
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
@using ClassifiedAds.WebMVC
22
@using ClassifiedAds.WebMVC.Models
33
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4-
54
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore
6-
7-
@using StackExchange.Profiling
8-
@addTagHelper *, MiniProfiler.AspNetCore.Mvc

src/Monolith/ClassifiedAds.WebMVC/appsettings.json

-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@
7575
}
7676
},
7777
"Monitoring": {
78-
"MiniProfiler": {
79-
"IsEnabled": true
80-
},
8178
"AzureApplicationInsights": {
8279
"IsEnabled": false
8380
},

0 commit comments

Comments
 (0)