@@ -51,7 +51,6 @@ public class ProducerPerformance {
51
51
52
52
public static final String DEFAULT_TRANSACTION_ID_PREFIX = "performance-producer-" ;
53
53
public static final long DEFAULT_TRANSACTION_DURATION_MS = 3000L ;
54
- public static final int DEFAULT_REPORTING_INTERVAL_MS = 5000 ;
55
54
56
55
public static void main (String [] args ) throws Exception {
57
56
ProducerPerformance perf = new ProducerPerformance ();
@@ -77,12 +76,10 @@ void start(String[] args) throws IOException {
77
76
SplittableRandom random = new SplittableRandom (0 );
78
77
ProducerRecord <byte [], byte []> record ;
79
78
80
- System .out .println ("DEBUG: config.warmupRecords=" + config .warmupRecords + ", (config.warmupRecords > 0)=" + (config .warmupRecords > 0 ));
81
-
82
79
if (config .warmupRecords > 0 ) {
83
80
System .out .println ("Warmup first " + config .warmupRecords + " records. Steady state results will print after the complete test summary." );
84
81
}
85
- stats = new Stats (config .numRecords , DEFAULT_REPORTING_INTERVAL_MS );
82
+ stats = new Stats (config .numRecords );
86
83
long startMs = System .currentTimeMillis ();
87
84
88
85
ThroughputThrottler throttler = new ThroughputThrottler (config .throughput , startMs );
@@ -102,7 +99,7 @@ record = new ProducerRecord<>(config.topicName, payload);
102
99
103
100
long sendStartMs = System .currentTimeMillis ();
104
101
if ( config .warmupRecords > 0 && i == config .warmupRecords ) {
105
- steadyStateStats = new Stats (config .numRecords - config .warmupRecords , DEFAULT_REPORTING_INTERVAL_MS , config .warmupRecords > 0 );
102
+ steadyStateStats = new Stats (config .numRecords - config .warmupRecords , config .warmupRecords > 0 );
106
103
stats .steadyStateActive = true ;
107
104
}
108
105
cb = new PerfCallback (sendStartMs , payload .length , stats , steadyStateStats );
@@ -378,11 +375,11 @@ static class Stats {
378
375
private final boolean isSteadyState ;
379
376
private boolean steadyStateActive ;
380
377
381
- public Stats (long numRecords , int reportingInterval ) {
382
- this (numRecords , reportingInterval , false );
378
+ public Stats (long numRecords ) {
379
+ this (numRecords , false );
383
380
}
384
381
385
- public Stats (long numRecords , int reportingInterval , boolean isSteadyState ) {
382
+ public Stats (long numRecords , boolean isSteadyState ) {
386
383
this .start = System .currentTimeMillis ();
387
384
this .windowStart = System .currentTimeMillis ();
388
385
this .iteration = 0 ;
@@ -395,7 +392,7 @@ public Stats(long numRecords, int reportingInterval, boolean isSteadyState) {
395
392
this .windowTotalLatency = 0 ;
396
393
this .windowBytes = 0 ;
397
394
this .totalLatency = 0 ;
398
- this .reportingInterval = reportingInterval ;
395
+ this .reportingInterval = 5000 ;
399
396
this .isSteadyState = isSteadyState ;
400
397
this .steadyStateActive = isSteadyState ;
401
398
}
0 commit comments