Skip to content

Commit 0ca941c

Browse files
committed
refinements
1 parent 5c01415 commit 0ca941c

20 files changed

Lines changed: 201 additions & 138 deletions

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<RepositoryType>git</RepositoryType>
1818
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
1919
<PackageReadmeFile>README.md</PackageReadmeFile>
20+
<PackageIcon>icon.png</PackageIcon>
2021
<PackageTags>orleans;eventsourcing;kurrent;eventstore;eventstoredb;log-consistency</PackageTags>
2122
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2223
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net10.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.Extensions.Hosting" />
12+
<PackageReference Include="Microsoft.Orleans.Server" />
13+
<PackageReference Include="Microsoft.Orleans.Dashboard" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\src\Orleans.EventSourcing.Kurrent\Orleans.EventSourcing.Kurrent.csproj" />
18+
</ItemGroup>
19+
20+
</Project>

LoadTest.Dashboard/Program.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using KurrentDB.Client;
2+
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.Extensions.Hosting;
4+
using Orleans.Dashboard;
5+
using Orleans.EventSourcing.Kurrent.Hosting;
6+
7+
// Connection string for KurrentDB. The special host "kurrentemulator" selects the in-process,
8+
// in-memory Kurrent implementation so the load test runs without external infrastructure.
9+
// Point KURRENT_CONNECTION_STRING at a real KurrentDB instance to measure end-to-end performance.
10+
var connectionString = Environment.GetEnvironmentVariable("KURRENT_CONNECTION_STRING")
11+
?? "esdb://localhost:2113?tls=false";
12+
13+
var clientSettings = KurrentDBClientSettings.Create(connectionString);
14+
15+
// Create a separate web application for the dashboard
16+
var dashboardBuilder = WebApplication.CreateBuilder(args);
17+
18+
// Configure Orleans client
19+
dashboardBuilder.UseOrleansClient(clientBuilder =>
20+
{
21+
clientBuilder.UseKurrentClustering(options => options.ClientSettings = clientSettings);
22+
23+
// Add dashboard services to the client
24+
clientBuilder.AddDashboard();
25+
});
26+
27+
var dashboardApp = dashboardBuilder.Build();
28+
29+
// Map dashboard endpoints on the client
30+
dashboardApp.MapOrleansDashboard();
31+
32+
await dashboardApp.RunAsync();

Orleans.EventSourcing.Kurrent.slnx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
<Project Path="tests/Orleans.EventSourcing.Kurrent.Tests/Orleans.EventSourcing.Kurrent.Tests.csproj" />
1818
</Folder>
1919
<Folder Name="/samples/">
20+
<Project Path="LoadTest.Dashboard/LoadTest.Dashboard.csproj" Id="732a0c1b-0c5a-4870-aa44-20219cbe65c7">
21+
<Build Solution="Debug|*" Project="false" />
22+
</Project>
23+
<Project Path="samples/LoadTest.Client/LoadTest.Client.csproj" />
2024
<Project Path="samples/LoadTest.Grains/LoadTest.Grains.csproj" />
2125
<Project Path="samples/LoadTest.Silo/LoadTest.Silo.csproj" />
22-
<Project Path="samples/LoadTest.Client/LoadTest.Client.csproj" />
2326
</Folder>
2427
</Solution>

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ builder.UseOrleansClient(client =>
7676

7777
The storage extensions also have non-default overloads that take a provider `name` so you can register multiple instances side-by-side.
7878

79+
To run KurrentDB locally (running **insecure** for testing only):
80+
```sh
81+
docker run --name kurrentdb-node -it -p 2113:2113 docker.kurrent.io/kurrent-latest/kurrentdb:latest --insecure
82+
```
83+
7984
## Using the clustering provider
8085

81-
The clustering provider implements `IMembershipTable` as an event-sourced aggregate, which materialises a `MembershipView` by reading
82-
the events stored in the cluster's event stream.
86+
The clustering provider event-sources the orleans `IMembershipTable` and by writing membership events to the cluster's event stream.
8387

8488
The stream contains `MembershipUpdate` events written by silos as they join or when their status or suspect list changes. Silos also update their `IAmAlive` value every 30 seconds by default; these are recorded as `SiloAlive` events.
8589

icon.png

7.18 KB
Loading

samples/LoadTest.Client/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// in-memory Kurrent implementation so the load test runs without external infrastructure.
2525
// Point KURRENT_CONNECTION_STRING at a real KurrentDB instance to measure end-to-end performance.
2626
var connectionString = Environment.GetEnvironmentVariable("KURRENT_CONNECTION_STRING")
27-
?? "esdb://kurrentemulator:2113?tls=false";
27+
?? "esdb://localhost:2113?tls=false";
2828

2929
var builder = Host.CreateApplicationBuilder(args);
3030
builder.Logging.AddFilter("Orleans", LogLevel.Warning);

samples/LoadTest.Client/Properties/launchSettings.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

samples/LoadTest.Silo/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// in-memory Kurrent implementation so the load test runs without external infrastructure.
1212
// Point KURRENT_CONNECTION_STRING at a real KurrentDB instance to measure end-to-end performance.
1313
var connectionString = Environment.GetEnvironmentVariable("KURRENT_CONNECTION_STRING")
14-
?? "esdb://kurrentemulator:2113?tls=false";
14+
?? "esdb://localhost:2113?tls=false";
1515

1616
// GRAIN_SERIALIZER selects the event payload serializer for the log-consistency provider:
1717
// "orleans" (default) — Orleans binary serializer
@@ -22,13 +22,14 @@
2222

2323
var clientSettings = KurrentDBClientSettings.Create(connectionString);
2424

25-
var builder = WebApplication.CreateBuilder(args);
25+
var builder = Host.CreateApplicationBuilder(args);
2626

2727
builder.Logging.AddFilter("Orleans", LogLevel.Warning);
2828
builder.Logging.AddFilter("Microsoft", LogLevel.Warning);
2929

3030
builder.UseOrleans(silo =>
3131
{
32+
silo.ConfigureEndpoints(Random.Shared.Next(29170, 29998), Random.Shared.Next(29170, 29998));
3233
silo.AddDashboard();
3334
silo.UseKurrentClustering(o => { o.ClientSettings = clientSettings; o.EventCountBeforeSnapshot = 5; });
3435
//silo.UseLocalhostClustering();
@@ -45,8 +46,6 @@
4546

4647
var host = builder.Build();
4748

48-
host.MapOrleansDashboard();
49-
5049
Console.WriteLine($"LoadTest silo starting (Kurrent: {connectionString}, serializer: {serializerName})...");
5150
await host.StartAsync();
5251
Console.WriteLine("LoadTest silo is running. Press Ctrl+C to shut down.");

samples/LoadTest.Silo/Properties/launchSettings.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)