Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding NBench 2.0 to 1.3 Akka.NET (#4293)
* per #4292 - adding NBench 2.0 to 1.3 Akka.NET * added NBench 2.0 support to build system * added ClusterStartupSpec
- Loading branch information
1 parent
5542210
commit c0cec03
Showing
15 changed files
with
163 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 5 additions & 9 deletions
14
src/core/Akka.Cluster.Tests.Performance/Akka.Cluster.Tests.Performance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\common.props" /> | ||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Cluster.Tests.Performance</AssemblyTitle> | ||
<TargetFrameworks>net452</TargetFrameworks> | ||
<TargetFramework>$(NetCoreTestVersion)</TargetFramework> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<IsPackable>false</IsPackable> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="App.config" /> | ||
<ProjectReference Include="..\Akka.Cluster\Akka.Cluster.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NBench" Version="1.0.1" /> | ||
<PackageReference Include="NBench" Version="$(NBenchVersion)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using NBench; | ||
|
||
namespace Akka.Cluster.Tests.Performance | ||
{ | ||
class Program | ||
{ | ||
static int Main(string[] args) | ||
{ | ||
return NBenchRunner.Run<Program>(); | ||
} | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/core/Akka.Cluster.Tests.Performance/Startup/ClusterStartupSpec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Akka.Actor; | ||
using Akka.Configuration; | ||
using NBench; | ||
|
||
namespace Akka.Cluster.Tests.Performance.Startup | ||
{ | ||
/// <summary> | ||
/// Measures end to end startup time, including HOCON parsing | ||
/// </summary> | ||
public class ClusterStartup2NodeSpec | ||
{ | ||
public ActorSystem Sys { get; set; } | ||
public ActorSystem OtherSys { get; set; } | ||
|
||
public const string SystemConfig = @"akka.actor.provider = cluster | ||
akka.remote.dot-netty.tcp.port = 8110 | ||
akka.remote.dot-netty.tcp.hostname = 0.0.0.0 | ||
akka.remote.dot-netty.tcp.public-hostname = localhost | ||
akka.cluster.seed-nodes = [""akka.tcp://ClusterSys@localhost:8110""]"; | ||
|
||
public TaskCompletionSource<Done> _clusterMemberUp = new TaskCompletionSource<Done>(); | ||
|
||
[PerfSetup] | ||
public void Setup(BenchmarkContext context) | ||
{ | ||
var config = ConfigurationFactory.ParseString(SystemConfig); | ||
OtherSys = ActorSystem.Create("ClusterSys", config); | ||
context.Trace.Info($"Started ActorSystem1 on {Cluster.Get(OtherSys).SelfAddress}"); | ||
} | ||
|
||
[PerfBenchmark(Description = "Measures end to end startup time to create a 2 node cluster", NumberOfIterations = 3, RunMode = RunMode.Iterations)] | ||
[TimingMeasurement] | ||
[MemoryMeasurement(MemoryMetric.TotalBytesAllocated)] | ||
[GcMeasurement(GcMetric.TotalCollections, GcGeneration.AllGc)] | ||
public void Run(BenchmarkContext context) | ||
{ | ||
context.Trace.Info("Configuring ActorSystem2"); | ||
|
||
// adding a fallback specifically here as a point of measurement | ||
var config2 = ConfigurationFactory.ParseString("akka.remote.dot-netty.tcp.port = 0") | ||
.WithFallback(OtherSys.Settings.Config); | ||
Sys = ActorSystem.Create("ClusterSys", config2); | ||
|
||
Cluster.Get(Sys).RegisterOnMemberUp(() => { _clusterMemberUp.TrySetResult(Done.Instance); }); | ||
context.Trace.Info($"Started ActorSystem1 on {Cluster.Get(OtherSys).SelfAddress}"); | ||
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30)); | ||
_clusterMemberUp.Task.Wait(cts.Token); | ||
context.Trace.Info($"Successfully joined cluster."); | ||
} | ||
|
||
[PerfCleanup] | ||
public void Cleanup() | ||
{ | ||
OtherSys?.Terminate(); | ||
Sys?.Terminate().Wait(TimeSpan.FromSeconds(5)); | ||
} | ||
} | ||
} |
15 changes: 6 additions & 9 deletions
15
src/core/Akka.Remote.Tests.Performance/Akka.Remote.Tests.Performance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\common.props" /> | ||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Remote.Tests.Performance</AssemblyTitle> | ||
<TargetFrameworks>net452</TargetFrameworks> | ||
<TargetFramework>$(NetCoreTestVersion)</TargetFramework> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<IsPackable>false</IsPackable> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
|
||
|
||
<ItemGroup> | ||
<Content Include="App.config" /> | ||
<ProjectReference Include="..\Akka.Remote\Akka.Remote.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NBench" Version="1.0.1" /> | ||
<PackageReference Include="NBench" Version="$(NBenchVersion)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using NBench; | ||
|
||
namespace Akka.Remote.Tests.Performance | ||
{ | ||
class Program | ||
{ | ||
static int Main(string[] args) | ||
{ | ||
return NBenchRunner.Run<Program>(); | ||
} | ||
} | ||
} |
19 changes: 5 additions & 14 deletions
19
src/core/Akka.Streams.Tests.Performance/Akka.Streams.Tests.Performance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\common.props" /> | ||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Streams.Tests.Performance</AssemblyTitle> | ||
<TargetFrameworks>net452</TargetFrameworks> | ||
<TargetFramework>$(NetCoreTestVersion)</TargetFramework> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<IsPackable>false</IsPackable> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="App.config" /> | ||
<ProjectReference Include="..\Akka.Streams\Akka.Streams.csproj" /> | ||
<ProjectReference Include="..\Akka.Streams.Tests\Akka.Streams.Tests.csproj" /> | ||
<ProjectReference Include="..\Akka.Streams.TestKit\Akka.Streams.TestKit.csproj" /> | ||
<ProjectReference Include="..\Akka.Streams.TestKit.Tests\Akka.Streams.TestKit.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NBench" Version="1.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' "> | ||
<Reference Include="System.Configuration" /> | ||
<Reference Include="System.Xml" /> | ||
<PackageReference Include="NBench" Version="$(NBenchVersion)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using NBench; | ||
|
||
namespace Akka.Streams.Tests.Performance | ||
{ | ||
class Program | ||
{ | ||
static int Main(string[] args) | ||
{ | ||
return NBenchRunner.Run<Program>(); | ||
} | ||
} | ||
} |
19 changes: 5 additions & 14 deletions
19
src/core/Akka.Tests.Performance/Akka.Tests.Performance.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\common.props" /> | ||
<PropertyGroup> | ||
<AssemblyTitle>Akka.Tests.Performance</AssemblyTitle> | ||
<TargetFrameworks>net452</TargetFrameworks> | ||
<TargetFramework>$(NetCoreTestVersion)</TargetFramework> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<IsPackable>false</IsPackable> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="App.config" /> | ||
<ProjectReference Include="..\Akka\Akka.csproj" /> | ||
<ProjectReference Include="..\Akka.TestKit\Akka.TestKit.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NBench" Version="1.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' "> | ||
<Reference Include="System.Configuration" /> | ||
<Reference Include="System.Xml" /> | ||
<PackageReference Include="NBench" Version="$(NBenchVersion)" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using NBench; | ||
|
||
namespace Akka.Tests.Performance | ||
{ | ||
class Program | ||
{ | ||
static int Main(string[] args) | ||
{ | ||
return NBenchRunner.Run<Program>(); | ||
} | ||
} | ||
} |