up
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
This commit is contained in:
@@ -1,37 +1,37 @@
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Baseline;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class BaselineLoaderTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task LoadAsync_ReadsEntries()
|
||||
{
|
||||
var path = Path.GetTempFileName();
|
||||
try
|
||||
{
|
||||
await File.WriteAllTextAsync(
|
||||
path,
|
||||
"scenario,iterations,observations,statements,events,mean_total_ms,p95_total_ms,max_total_ms,mean_insert_ms,mean_correlation_ms,mean_observation_throughput_per_sec,min_observation_throughput_per_sec,mean_event_throughput_per_sec,min_event_throughput_per_sec,max_allocated_mb\n" +
|
||||
"vex_ingest_baseline,5,4000,24000,12000,620.5,700.1,820.9,320.5,300.0,9800.0,9100.0,4200.0,3900.0,150.0\n");
|
||||
|
||||
var baseline = await BaselineLoader.LoadAsync(path, CancellationToken.None);
|
||||
var entry = Assert.Single(baseline);
|
||||
|
||||
Assert.Equal("vex_ingest_baseline", entry.Key);
|
||||
Assert.Equal(4000, entry.Value.Observations);
|
||||
Assert.Equal(24000, entry.Value.Statements);
|
||||
Assert.Equal(12000, entry.Value.Events);
|
||||
Assert.Equal(700.1, entry.Value.P95TotalMs);
|
||||
Assert.Equal(3900.0, entry.Value.MinEventThroughputPerSecond);
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Baseline;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class BaselineLoaderTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task LoadAsync_ReadsEntries()
|
||||
{
|
||||
var path = Path.GetTempFileName();
|
||||
try
|
||||
{
|
||||
await File.WriteAllTextAsync(
|
||||
path,
|
||||
"scenario,iterations,observations,statements,events,mean_total_ms,p95_total_ms,max_total_ms,mean_insert_ms,mean_correlation_ms,mean_observation_throughput_per_sec,min_observation_throughput_per_sec,mean_event_throughput_per_sec,min_event_throughput_per_sec,max_allocated_mb\n" +
|
||||
"vex_ingest_baseline,5,4000,24000,12000,620.5,700.1,820.9,320.5,300.0,9800.0,9100.0,4200.0,3900.0,150.0\n");
|
||||
|
||||
var baseline = await BaselineLoader.LoadAsync(path, CancellationToken.None);
|
||||
var entry = Assert.Single(baseline);
|
||||
|
||||
Assert.Equal("vex_ingest_baseline", entry.Key);
|
||||
Assert.Equal(4000, entry.Value.Observations);
|
||||
Assert.Equal(24000, entry.Value.Statements);
|
||||
Assert.Equal(12000, entry.Value.Events);
|
||||
Assert.Equal(700.1, entry.Value.P95TotalMs);
|
||||
Assert.Equal(3900.0, entry.Value.MinEventThroughputPerSecond);
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,83 +1,83 @@
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Baseline;
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Reporting;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class BenchmarkScenarioReportTests
|
||||
{
|
||||
[Fact]
|
||||
public void RegressionDetection_FlagsBreaches()
|
||||
{
|
||||
var result = new VexScenarioResult(
|
||||
Id: "scenario",
|
||||
Label: "Scenario",
|
||||
Iterations: 3,
|
||||
ObservationCount: 1000,
|
||||
AliasGroups: 100,
|
||||
StatementCount: 6000,
|
||||
EventCount: 3200,
|
||||
TotalStatistics: new DurationStatistics(600, 700, 750),
|
||||
InsertStatistics: new DurationStatistics(320, 360, 380),
|
||||
CorrelationStatistics: new DurationStatistics(280, 320, 340),
|
||||
ObservationThroughputStatistics: new ThroughputStatistics(8000, 7000),
|
||||
EventThroughputStatistics: new ThroughputStatistics(3500, 3200),
|
||||
AllocationStatistics: new AllocationStatistics(180),
|
||||
ThresholdMs: null,
|
||||
MinObservationThroughputPerSecond: null,
|
||||
MinEventThroughputPerSecond: null,
|
||||
MaxAllocatedThresholdMb: null);
|
||||
|
||||
var baseline = new BaselineEntry(
|
||||
ScenarioId: "scenario",
|
||||
Iterations: 3,
|
||||
Observations: 1000,
|
||||
Statements: 6000,
|
||||
Events: 3200,
|
||||
MeanTotalMs: 520,
|
||||
P95TotalMs: 560,
|
||||
MaxTotalMs: 580,
|
||||
MeanInsertMs: 250,
|
||||
MeanCorrelationMs: 260,
|
||||
MeanObservationThroughputPerSecond: 9000,
|
||||
MinObservationThroughputPerSecond: 8500,
|
||||
MeanEventThroughputPerSecond: 4200,
|
||||
MinEventThroughputPerSecond: 3800,
|
||||
MaxAllocatedMb: 140);
|
||||
|
||||
var report = new BenchmarkScenarioReport(result, baseline, regressionLimit: 1.1);
|
||||
|
||||
Assert.True(report.DurationRegressionBreached);
|
||||
Assert.True(report.ObservationThroughputRegressionBreached);
|
||||
Assert.True(report.EventThroughputRegressionBreached);
|
||||
Assert.Contains(report.BuildRegressionFailureMessages(), message => message.Contains("event throughput"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RegressionDetection_NoBaseline_NoBreaches()
|
||||
{
|
||||
var result = new VexScenarioResult(
|
||||
Id: "scenario",
|
||||
Label: "Scenario",
|
||||
Iterations: 3,
|
||||
ObservationCount: 1000,
|
||||
AliasGroups: 100,
|
||||
StatementCount: 6000,
|
||||
EventCount: 3200,
|
||||
TotalStatistics: new DurationStatistics(480, 520, 540),
|
||||
InsertStatistics: new DurationStatistics(260, 280, 300),
|
||||
CorrelationStatistics: new DurationStatistics(220, 240, 260),
|
||||
ObservationThroughputStatistics: new ThroughputStatistics(9000, 8800),
|
||||
EventThroughputStatistics: new ThroughputStatistics(4200, 4100),
|
||||
AllocationStatistics: new AllocationStatistics(150),
|
||||
ThresholdMs: null,
|
||||
MinObservationThroughputPerSecond: null,
|
||||
MinEventThroughputPerSecond: null,
|
||||
MaxAllocatedThresholdMb: null);
|
||||
|
||||
var report = new BenchmarkScenarioReport(result, baseline: null, regressionLimit: null);
|
||||
|
||||
Assert.False(report.RegressionBreached);
|
||||
Assert.Empty(report.BuildRegressionFailureMessages());
|
||||
}
|
||||
}
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Baseline;
|
||||
using StellaOps.Bench.LinkNotMerge.Vex.Reporting;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class BenchmarkScenarioReportTests
|
||||
{
|
||||
[Fact]
|
||||
public void RegressionDetection_FlagsBreaches()
|
||||
{
|
||||
var result = new VexScenarioResult(
|
||||
Id: "scenario",
|
||||
Label: "Scenario",
|
||||
Iterations: 3,
|
||||
ObservationCount: 1000,
|
||||
AliasGroups: 100,
|
||||
StatementCount: 6000,
|
||||
EventCount: 3200,
|
||||
TotalStatistics: new DurationStatistics(600, 700, 750),
|
||||
InsertStatistics: new DurationStatistics(320, 360, 380),
|
||||
CorrelationStatistics: new DurationStatistics(280, 320, 340),
|
||||
ObservationThroughputStatistics: new ThroughputStatistics(8000, 7000),
|
||||
EventThroughputStatistics: new ThroughputStatistics(3500, 3200),
|
||||
AllocationStatistics: new AllocationStatistics(180),
|
||||
ThresholdMs: null,
|
||||
MinObservationThroughputPerSecond: null,
|
||||
MinEventThroughputPerSecond: null,
|
||||
MaxAllocatedThresholdMb: null);
|
||||
|
||||
var baseline = new BaselineEntry(
|
||||
ScenarioId: "scenario",
|
||||
Iterations: 3,
|
||||
Observations: 1000,
|
||||
Statements: 6000,
|
||||
Events: 3200,
|
||||
MeanTotalMs: 520,
|
||||
P95TotalMs: 560,
|
||||
MaxTotalMs: 580,
|
||||
MeanInsertMs: 250,
|
||||
MeanCorrelationMs: 260,
|
||||
MeanObservationThroughputPerSecond: 9000,
|
||||
MinObservationThroughputPerSecond: 8500,
|
||||
MeanEventThroughputPerSecond: 4200,
|
||||
MinEventThroughputPerSecond: 3800,
|
||||
MaxAllocatedMb: 140);
|
||||
|
||||
var report = new BenchmarkScenarioReport(result, baseline, regressionLimit: 1.1);
|
||||
|
||||
Assert.True(report.DurationRegressionBreached);
|
||||
Assert.True(report.ObservationThroughputRegressionBreached);
|
||||
Assert.True(report.EventThroughputRegressionBreached);
|
||||
Assert.Contains(report.BuildRegressionFailureMessages(), message => message.Contains("event throughput"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RegressionDetection_NoBaseline_NoBreaches()
|
||||
{
|
||||
var result = new VexScenarioResult(
|
||||
Id: "scenario",
|
||||
Label: "Scenario",
|
||||
Iterations: 3,
|
||||
ObservationCount: 1000,
|
||||
AliasGroups: 100,
|
||||
StatementCount: 6000,
|
||||
EventCount: 3200,
|
||||
TotalStatistics: new DurationStatistics(480, 520, 540),
|
||||
InsertStatistics: new DurationStatistics(260, 280, 300),
|
||||
CorrelationStatistics: new DurationStatistics(220, 240, 260),
|
||||
ObservationThroughputStatistics: new ThroughputStatistics(9000, 8800),
|
||||
EventThroughputStatistics: new ThroughputStatistics(4200, 4100),
|
||||
AllocationStatistics: new AllocationStatistics(150),
|
||||
ThresholdMs: null,
|
||||
MinObservationThroughputPerSecond: null,
|
||||
MinEventThroughputPerSecond: null,
|
||||
MaxAllocatedThresholdMb: null);
|
||||
|
||||
var report = new BenchmarkScenarioReport(result, baseline: null, regressionLimit: null);
|
||||
|
||||
Assert.False(report.RegressionBreached);
|
||||
Assert.Empty(report.BuildRegressionFailureMessages());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class VexScenarioRunnerTests
|
||||
{
|
||||
[Fact]
|
||||
public void Execute_ComputesEvents()
|
||||
{
|
||||
var config = new VexScenarioConfig
|
||||
{
|
||||
Id = "unit",
|
||||
Observations = 600,
|
||||
AliasGroups = 120,
|
||||
StatementsPerObservation = 5,
|
||||
ProductsPerObservation = 3,
|
||||
Tenants = 2,
|
||||
BatchSize = 120,
|
||||
Seed = 12345,
|
||||
};
|
||||
|
||||
var runner = new VexScenarioRunner(config);
|
||||
var result = runner.Execute(2, CancellationToken.None);
|
||||
|
||||
Assert.Equal(600, result.ObservationCount);
|
||||
Assert.True(result.StatementCount > 0);
|
||||
Assert.True(result.EventCount > 0);
|
||||
Assert.All(result.TotalDurationsMs, duration => Assert.True(duration > 0));
|
||||
Assert.All(result.EventThroughputsPerSecond, throughput => Assert.True(throughput > 0));
|
||||
Assert.Equal(result.AggregationResult.EventCount, result.EventCount);
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Xunit;
|
||||
|
||||
namespace StellaOps.Bench.LinkNotMerge.Vex.Tests;
|
||||
|
||||
public sealed class VexScenarioRunnerTests
|
||||
{
|
||||
[Fact]
|
||||
public void Execute_ComputesEvents()
|
||||
{
|
||||
var config = new VexScenarioConfig
|
||||
{
|
||||
Id = "unit",
|
||||
Observations = 600,
|
||||
AliasGroups = 120,
|
||||
StatementsPerObservation = 5,
|
||||
ProductsPerObservation = 3,
|
||||
Tenants = 2,
|
||||
BatchSize = 120,
|
||||
Seed = 12345,
|
||||
};
|
||||
|
||||
var runner = new VexScenarioRunner(config);
|
||||
var result = runner.Execute(2, CancellationToken.None);
|
||||
|
||||
Assert.Equal(600, result.ObservationCount);
|
||||
Assert.True(result.StatementCount > 0);
|
||||
Assert.True(result.EventCount > 0);
|
||||
Assert.All(result.TotalDurationsMs, duration => Assert.True(duration > 0));
|
||||
Assert.All(result.EventThroughputsPerSecond, throughput => Assert.True(throughput > 0));
|
||||
Assert.Equal(result.AggregationResult.EventCount, result.EventCount);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user