Skip to content

Commit

Permalink
chore(deps): updated all deps and fixed stress test code
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl committed Dec 9, 2023
1 parent d5035dc commit 4b8c52d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/Vfps.Benchmarks/Vfps.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Vfps.IntegrationTests/Vfps.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Testcontainers" Version="3.5.0" />
<PackageReference Include="Testcontainers.PostgreSql" Version="3.5.0" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Testcontainers" Version="3.6.0" />
<PackageReference Include="Testcontainers.PostgreSql" Version="3.6.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
32 changes: 17 additions & 15 deletions src/Vfps.StressTests/StressTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ out bool isRunningInContainer
: "./nbomber-reports";
}

private IStep CreatePseudonymStep(string namespaceName)
private async Task<Response<object>> RunCreatePseudonyms(IScenarioContext scenarioContext, string namespaceName)
{
return Step.Create(
return await Step.Run(
"create_pseudonyms",
execute: async context =>
scenarioContext,
run: async () =>
{
var request = new PseudonymServiceCreateRequest()
{
Expand All @@ -65,13 +66,13 @@ private IStep CreatePseudonymStep(string namespaceName)
{
var response = await pseudonymService.CreateAsync(request);
return Response.Ok(
statusCode: 200,
statusCode: "200",
sizeBytes: request.CalculateSize() + response.CalculateSize()
);
}
catch (RpcException exc)
{
context.Logger.Error(exc, "Pseudonym creation failed");
scenarioContext.Logger.Error(exc, "Pseudonym creation failed");
return Response.Fail();
}
}
Expand All @@ -89,8 +90,14 @@ public void RunStressSimulation()
PseudonymPrefix = "stress-",
};

var scenario = ScenarioBuilder
.CreateScenario(namespaceRequest.Name, CreatePseudonymStep(namespaceRequest.Name))
var scenario = Scenario
.Create(
namespaceRequest.Name,
async context =>
{
return await RunCreatePseudonyms(context, namespaceRequest.Name);
}
)
.WithInit(async context =>
{
try
Expand All @@ -106,13 +113,8 @@ public void RunStressSimulation()
})
.WithWarmUpDuration(TimeSpan.FromSeconds(5))
.WithLoadSimulations(
Simulation.RampConstant(copies: 10, during: TimeSpan.FromMinutes(5)),
Simulation.KeepConstant(copies: 100, during: TimeSpan.FromMinutes(5)),
Simulation.InjectPerSecRandom(
minRate: 10,
maxRate: 50,
during: TimeSpan.FromMinutes(5)
)
Simulation.RampingConstant(copies: 10, during: TimeSpan.FromMinutes(5)),
Simulation.KeepConstant(copies: 100, during: TimeSpan.FromMinutes(10))
);

var stats = NBomberRunner
Expand All @@ -126,7 +128,7 @@ public void RunStressSimulation()
)
.Run();

var failPercentage = stats.FailCount / (double)stats.RequestCount * 100.0;
var failPercentage = stats.AllFailCount / (double)stats.AllRequestCount * 100.0;
failPercentage.Should().BeLessThan(0.1);
}
}
8 changes: 4 additions & 4 deletions src/Vfps.StressTests/Vfps.StressTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="NBomber" Version="3.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="NBomber" Version="5.4.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
14 changes: 7 additions & 7 deletions src/Vfps.Tests/Vfps.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="EntityFrameworkCore.Exceptions.Sqlite" Version="6.0.3" />
<PackageReference Include="FakeItEasy" Version="7.4.0" />
<PackageReference Include="FakeItEasy" Version="8.0.0" />
<PackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.13" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
38 changes: 19 additions & 19 deletions src/Vfps/Vfps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
<PackageReference Include="EFCore.NamingConventions" Version="8.0.0-rc.2" />
<PackageReference Include="EntityFrameworkCore.Exceptions.PostgreSQL" Version="6.0.3" />
<PackageReference Include="Grpc.AspNetCore" Version="2.58.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.58.0" />
<PackageReference Include="Grpc.AspNetCore.Server.Reflection" Version="2.58.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.59.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.59.0" />
<PackageReference Include="Grpc.AspNetCore.Server.Reflection" Version="2.59.0" />
<PackageReference Include="Hl7.Fhir.R4" Version="5.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Grpc.Swagger" Version="0.3.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.13">
<PackageReference Include="Microsoft.AspNetCore.Grpc.Swagger" Version="0.8.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="7.0.13" />
<PackageReference Include="Npgsql" Version="7.0.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
<PackageReference Include="Npgsql.OpenTelemetry" Version="7.0.6" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.13" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageReference Include="Npgsql.OpenTelemetry" Version="8.0.1" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.5.1-beta.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.1.0" />
<PackageReference Include="prometheus-net.AspNetCore.Grpc" Version="8.1.0" />
<PackageReference Include="prometheus-net.AspNetCore.HealthChecks" Version="8.1.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.0-rc.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.0" />
<PackageReference Include="prometheus-net.AspNetCore.Grpc" Version="8.2.0" />
<PackageReference Include="prometheus-net.AspNetCore.HealthChecks" Version="8.2.0" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\vfps\api\v1\*.proto" />
Expand Down

0 comments on commit 4b8c52d

Please sign in to comment.