feat: add benchmark test project for Go vs .NET server comparison
Side-by-side performance benchmarks using NATS.Client.Core against both servers on ephemeral ports. Includes core pub/sub, request/reply latency, and JetStream throughput tests with comparison output and benchmarks_comparison.md results. Also fixes timestamp flakiness in StoreInterfaceTests by using explicit timestamps.
This commit is contained in:
27
tests/NATS.Server.Benchmark.Tests/Harness/BenchmarkResult.cs
Normal file
27
tests/NATS.Server.Benchmark.Tests/Harness/BenchmarkResult.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace NATS.Server.Benchmark.Tests.Harness;
|
||||
|
||||
/// <summary>
|
||||
/// Captures the results of a single benchmark run against one server.
|
||||
/// </summary>
|
||||
public sealed record BenchmarkResult
|
||||
{
|
||||
public required string Name { get; init; }
|
||||
public required string ServerType { get; init; }
|
||||
public required long TotalMessages { get; init; }
|
||||
public required long TotalBytes { get; init; }
|
||||
public required TimeSpan Duration { get; init; }
|
||||
|
||||
/// <summary>Latency percentiles in microseconds, if measured.</summary>
|
||||
public LatencyPercentiles? Latencies { get; init; }
|
||||
|
||||
public double MessagesPerSecond => TotalMessages / Duration.TotalSeconds;
|
||||
public double BytesPerSecond => TotalBytes / Duration.TotalSeconds;
|
||||
public double MegabytesPerSecond => BytesPerSecond / (1024.0 * 1024.0);
|
||||
}
|
||||
|
||||
public sealed record LatencyPercentiles(
|
||||
double P50Us,
|
||||
double P95Us,
|
||||
double P99Us,
|
||||
double MinUs,
|
||||
double MaxUs);
|
||||
Reference in New Issue
Block a user