diff --git a/backend/src/Squidex.Infrastructure/Dump/Dumper.cs b/backend/src/Squidex.Infrastructure/Diagnostics/Diagnoser.cs similarity index 92% rename from backend/src/Squidex.Infrastructure/Dump/Dumper.cs rename to backend/src/Squidex.Infrastructure/Diagnostics/Diagnoser.cs index 4cc2c6d6c..8aeb2c122 100644 --- a/backend/src/Squidex.Infrastructure/Dump/Dumper.cs +++ b/backend/src/Squidex.Infrastructure/Diagnostics/Diagnoser.cs @@ -10,12 +10,12 @@ using Microsoft.Extensions.Options; using Squidex.Assets; using Squidex.Hosting; -namespace Squidex.Infrastructure.Dump +namespace Squidex.Infrastructure.Diagnostics { - public sealed class Dumper : IInitializable + public sealed class Diagnoser : IInitializable { private static readonly TimeSpan DefaultTimeout = TimeSpan.FromMinutes(30); - private readonly DumperOptions options; + private readonly DiagnoserOptions options; private readonly IAssetStore assetStore; private Task? scheduledGcDumpTask; private Task? scheduledDumpTask; @@ -23,7 +23,7 @@ namespace Squidex.Infrastructure.Dump public int Order => int.MaxValue; - public Dumper(IOptions options, IAssetStore assetStore) + public Diagnoser(IOptions options, IAssetStore assetStore) { this.options = options.Value; this.assetStore = assetStore; @@ -32,7 +32,7 @@ namespace Squidex.Infrastructure.Dump public Task InitializeAsync( CancellationToken ct) { - if (options.DumTrigger > 0 || options.GCDumpTrigger > 0) + if (options.DumpTrigger > 0 || options.GCDumpTrigger > 0) { timer = new Timer(CollectDump); timer.Change(TimeSpan.Zero, TimeSpan.FromSeconds(5)); @@ -70,7 +70,7 @@ namespace Squidex.Infrastructure.Dump { var usage = GC.GetTotalMemory(false) / (1024 * 1024); - if (options.DumTrigger > 0 && usage > options.DumTrigger && scheduledDumpTask == null) + if (options.DumpTrigger > 0 && usage > options.DumpTrigger && scheduledDumpTask == null) { scheduledDumpTask = CreateDumpAsync(); } @@ -84,7 +84,6 @@ namespace Squidex.Infrastructure.Dump catch #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body { - } } diff --git a/backend/src/Squidex.Infrastructure/Dump/DumperOptions.cs b/backend/src/Squidex.Infrastructure/Diagnostics/DiagnoserOptions.cs similarity index 80% rename from backend/src/Squidex.Infrastructure/Dump/DumperOptions.cs rename to backend/src/Squidex.Infrastructure/Diagnostics/DiagnoserOptions.cs index 3386f9f2f..425f5c867 100644 --- a/backend/src/Squidex.Infrastructure/Dump/DumperOptions.cs +++ b/backend/src/Squidex.Infrastructure/Diagnostics/DiagnoserOptions.cs @@ -5,9 +5,9 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -namespace Squidex.Infrastructure.Dump +namespace Squidex.Infrastructure.Diagnostics { - public sealed class DumperOptions + public sealed class DiagnoserOptions { public string? GcDumpTool { get; set; } @@ -15,6 +15,6 @@ namespace Squidex.Infrastructure.Dump public int GCDumpTrigger { get; set; } - public int DumTrigger { get; set; } + public int DumpTrigger { get; set; } } } diff --git a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj index 1a2320e15..933c886f6 100644 --- a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj +++ b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj @@ -62,4 +62,7 @@ Resources.Designer.cs + + + diff --git a/backend/src/Squidex/Areas/Api/Controllers/Diagnostics/DiagnosticsController.cs b/backend/src/Squidex/Areas/Api/Controllers/Diagnostics/DiagnosticsController.cs index 0c511569d..761134ca8 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Diagnostics/DiagnosticsController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Diagnostics/DiagnosticsController.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc; using Squidex.Infrastructure.Commands; -using Squidex.Infrastructure.Dump; +using Squidex.Infrastructure.Diagnostics; using Squidex.Shared; using Squidex.Web; @@ -19,9 +19,9 @@ namespace Squidex.Areas.Api.Controllers.Diagnostics [ApiExplorerSettings(GroupName = nameof(Diagnostics))] public sealed class DiagnosticsController : ApiController { - private readonly Dumper dumper; + private readonly Diagnoser dumper; - public DiagnosticsController(ICommandBus commandBus, Dumper dumper) + public DiagnosticsController(ICommandBus commandBus, Diagnoser dumper) : base(commandBus) { this.dumper = dumper; @@ -57,7 +57,7 @@ namespace Squidex.Areas.Api.Controllers.Diagnostics /// 501 => Not configured. /// [HttpGet] - [Route("diagnostics/gc-dump")] + [Route("diagnostics/gcdump")] [ApiPermissionOrAnonymous(Permissions.Admin)] public async Task GetGCDump() { diff --git a/backend/src/Squidex/Config/Domain/InfrastructureServices.cs b/backend/src/Squidex/Config/Domain/InfrastructureServices.cs index f1df56353..7ee257b19 100644 --- a/backend/src/Squidex/Config/Domain/InfrastructureServices.cs +++ b/backend/src/Squidex/Config/Domain/InfrastructureServices.cs @@ -23,7 +23,7 @@ using Squidex.Domain.Apps.Entities.Rules.UsageTracking; using Squidex.Domain.Apps.Entities.Tags; using Squidex.Infrastructure; using Squidex.Infrastructure.Commands; -using Squidex.Infrastructure.Dump; +using Squidex.Infrastructure.Diagnostics; using Squidex.Infrastructure.EventSourcing.Grains; using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Orleans; @@ -51,7 +51,7 @@ namespace Squidex.Config.Domain services.Configure(config, "scripting"); - services.Configure(config, + services.Configure(config, "diagnostics"); services.AddReplicatedCache(); @@ -67,7 +67,7 @@ namespace Squidex.Config.Domain services.AddSingletonAs() .AsOptional(); - services.AddSingletonAs() + services.AddSingletonAs() .AsSelf(); services.AddSingletonAs()