-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (22 loc) · 1.45 KB
/
Copy pathProgram.cs
File metadata and controls
29 lines (22 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using CSharpener;
// ── Wiring ────────────────────────────────────────────────────────────────────
var corePool = new CorePool();
var registry = new OperationRegistry(corePool);
var cts = new CancellationTokenSource();
var tokenQueue = new AdmissionQueue<Token> (corePool);
var ticketQueue = new AdmissionQueue<Ticket>(corePool);
var tokenizer = new Tokenizer (tokenQueue, registry);
var ticketCreator = new TicketCreator(ticketQueue, registry);
var background = Task.WhenAll(
tokenQueue .DrainAsync(cts.Token),
ticketQueue.DrainAsync(cts.Token),
corePool .StartAsync(cts.Token));
// ── Load test ─────────────────────────────────────────────────────────────────
var loadTest = new LoadTest(tokenizer, ticketCreator);
await loadTest.RunAsync(LoadTestConfig.Light);
// ── Statement test ────────────────────────────────────────────────────────────
var statementTest = new StatementTest(tokenizer, ticketCreator);
await statementTest.RunAsync(waves: 10, groupsPerDomain: 25);
cts.Cancel();
try { await background; } catch { }
Console.WriteLine("\nDone.");