Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NFury/Commands/Run/Request.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NFury.Commands.Run;
namespace NFury.Commands.Run;

internal sealed record Request(string Url, string Method, string? Body, string? ContentType, int NumberOfRequests)
{
Expand Down
4 changes: 2 additions & 2 deletions src/NFury/Commands/Run/Response.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Net;
using System.Net;

namespace NFury.Commands.Run;

internal sealed record Response(Guid Id, long ElapsedTime, HttpStatusCode StatusCode);
internal sealed record Response(Guid Id, long ElapsedTime, HttpStatusCode StatusCode);
6 changes: 3 additions & 3 deletions src/NFury/Commands/Run/RunCommand.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Spectre.Console;
using Spectre.Console.Cli;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Text;
using Spectre.Console;
using Spectre.Console.Cli;

namespace NFury.Commands.Run;

Expand Down Expand Up @@ -277,4 +277,4 @@ private static long CalculatePercentile(List<long> values, int percentile)
return (long)(values[intIndex] + fraction * (values[intIndex + 1] - values[intIndex]));
}
}
}
}
4 changes: 2 additions & 2 deletions src/NFury/Commands/Run/RunSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Spectre.Console.Cli;
using System.ComponentModel;
using Spectre.Console.Cli;

namespace NFury.Commands.Run;

Expand Down Expand Up @@ -30,7 +30,7 @@ public class RunSettings : CommandSettings
[CommandOption("-t|--content-type")]
[DefaultValue("application/json")]
[Description("Define the content type of request. Default is application/json.")]
public string? ContentType { get; set;}
public string? ContentType { get; set; }

[CommandOption("-d|--duration")]
[Description("Define the duration of test in seconds.")]
Expand Down
14 changes: 14 additions & 0 deletions src/NFury/Commands/Server/ServerCommand.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using NFury.Web;
using NFury.Web.Data;
using NFury.Web.Hubs;
Expand All @@ -7,8 +8,21 @@

namespace NFury.Commands.Server;

/// <summary>
/// Command to start the NFury web server with API endpoints and SignalR hub
/// </summary>
public class ServerCommand : AsyncCommand<ServerSettings>
{
/// <summary>
/// Executes the server command, starting the web application
/// </summary>
/// <param name="context">The command context</param>
/// <param name="settings">The server settings including port and host</param>
/// <returns>Exit code (0 for success)</returns>
[UnconditionalSuppressMessage("AOT", "IL2026:RequiresUnreferencedCode",
Justification = "ASP.NET Core Minimal APIs with source-generated JSON serialization is AOT compatible")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode",
Justification = "ASP.NET Core Minimal APIs with source-generated JSON serialization is AOT compatible")]
public override async Task<int> ExecuteAsync(CommandContext context, ServerSettings settings)
{
AnsiConsole.MarkupLine("[bold blue]Starting NFury Web Server...[/]");
Expand Down
2 changes: 1 addition & 1 deletion src/NFury/Commands/Server/ServerSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Spectre.Console.Cli;
using System.ComponentModel;
using Spectre.Console.Cli;

namespace NFury.Commands.Server;

Expand Down
6 changes: 3 additions & 3 deletions src/NFury/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using NFury.Commands.Run;
using System.Reflection;
using NFury.Commands.Run;
using NFury.Commands.Server;
using Spectre.Console;
using Spectre.Console.Cli;
using System.Reflection;

WriteCopyrigth();

Expand Down Expand Up @@ -43,4 +43,4 @@ static void WriteCopyrigth()
]);
AnsiConsole.Write(grid);
AnsiConsole.WriteLine();
}
}