Skip to content

Commit 335d8ef

Browse files
author
Simon MacMullen
committed
Stats should be instantiated immediately before you want to use them.
1 parent 7de1d4f commit 335d8ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/src/com/rabbitmq/examples/perf/SimpleScenario.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class SimpleScenario implements Scenario {
2424
private String name;
2525
private ConnectionFactory factory;
2626
private MulticastParams[] params;
27+
private long interval;
2728
private SimpleScenarioStats stats;
2829

2930
public SimpleScenario(String name, ConnectionFactory factory, MulticastParams... params) {
@@ -34,11 +35,12 @@ public SimpleScenario(String name, ConnectionFactory factory, long interval, Mul
3435
this.name = name;
3536
this.factory = factory;
3637
this.params = params;
37-
this.stats = new SimpleScenarioStats(interval);
38+
this.interval = interval;
3839
}
3940

4041
@Override
4142
public void run() throws IOException, InterruptedException {
43+
this.stats = new SimpleScenarioStats(interval);
4244
for (MulticastParams p : params) {
4345
MulticastSet set = new MulticastSet(stats, factory, p);
4446
set.run();

0 commit comments

Comments
 (0)