|
14 | 14 | using Akka.Cluster.Sharding; |
15 | 15 | using Akka.Routing; |
16 | 16 | using BenchmarkDotNet.Attributes; |
| 17 | +using BenchmarkDotNet.Diagnostics.dotTrace; |
17 | 18 | using static Akka.Cluster.Benchmarks.Sharding.ShardingHelper; |
18 | 19 |
|
19 | 20 | namespace Akka.Cluster.Benchmarks.Sharding |
20 | 21 | { |
| 22 | + [DotTraceDiagnoser] |
21 | 23 | [Config(typeof(MonitoringConfig))] |
22 | 24 | public class ShardMessageRoutingBenchmarks |
23 | 25 | { |
24 | 26 | [Params(StateStoreMode.Persistence, StateStoreMode.DData)] |
25 | 27 | public StateStoreMode StateMode; |
26 | 28 |
|
27 | | - [Params(10000)] |
28 | | - public int MsgCount; |
| 29 | + public const int MsgCount = 10000; |
29 | 30 |
|
30 | | - public int BatchSize = 20; |
| 31 | + public const int BatchSize = 20; |
31 | 32 |
|
32 | 33 | private ActorSystem _sys1; |
33 | 34 | private ActorSystem _sys2; |
@@ -141,36 +142,36 @@ public void PerIteration() |
141 | 142 | _batchActor = _sys1.ActorOf(Props.Create(() => new BulkSendActor(tcs, MsgCount))); |
142 | 143 | } |
143 | 144 |
|
144 | | - [Benchmark] |
| 145 | + [Benchmark(OperationsPerInvoke = MsgCount)] |
145 | 146 | public async Task SingleRequestResponseToLocalEntity() |
146 | 147 | { |
147 | 148 | for (var i = 0; i < MsgCount; i++) |
148 | 149 | await _shardRegion1.Ask<ShardedMessage>(_messageToSys1); |
149 | 150 | } |
150 | 151 |
|
151 | | - [Benchmark] |
| 152 | + [Benchmark(OperationsPerInvoke = MsgCount * BatchSize)] |
152 | 153 | public async Task StreamingToLocalEntity() |
153 | 154 | { |
154 | 155 | _batchActor.Tell(new BulkSendActor.BeginSend(_messageToSys1, _shardRegion1, BatchSize)); |
155 | 156 | await _batchComplete; |
156 | 157 | } |
157 | 158 |
|
158 | | - [Benchmark] |
| 159 | + [Benchmark(OperationsPerInvoke = MsgCount)] |
159 | 160 | public async Task SingleRequestResponseToRemoteEntity() |
160 | 161 | { |
161 | 162 | for (var i = 0; i < MsgCount; i++) |
162 | 163 | await _shardRegion1.Ask<ShardedMessage>(_messageToSys2); |
163 | 164 | } |
164 | 165 |
|
165 | 166 |
|
166 | | - [Benchmark] |
| 167 | + [Benchmark(OperationsPerInvoke = MsgCount)] |
167 | 168 | public async Task SingleRequestResponseToRemoteEntityWithLocalProxy() |
168 | 169 | { |
169 | 170 | for (var i = 0; i < MsgCount; i++) |
170 | 171 | await _localRouter.Ask<ShardedMessage>(new SendShardedMessage(_messageToSys2.EntityId, _messageToSys2)); |
171 | 172 | } |
172 | 173 |
|
173 | | - [Benchmark] |
| 174 | + [Benchmark(OperationsPerInvoke = MsgCount*BatchSize)] |
174 | 175 | public async Task StreamingToRemoteEntity() |
175 | 176 | { |
176 | 177 | _batchActor.Tell(new BulkSendActor.BeginSend(_messageToSys2, _shardRegion1, BatchSize)); |
|
0 commit comments