Renamed throttler

This commit is contained in:
Geoff Anderson 2015-06-03 18:09:14 -07:00
parent 9100417ce0
commit 1228eefc4e
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ public class ProducerPerformance {
Stats stats = new Stats(numRecords, 5000);
long startMs = System.currentTimeMillis();
MessageThroughputThrottler throttler = new MessageThroughputThrottler(throughput, startMs);
ThroughputThrottler throttler = new ThroughputThrottler(throughput, startMs);
for (int i = 0; i < numRecords; i++) {
long sendStartMs = System.currentTimeMillis();
Callback cb = stats.nextCompletion(sendStartMs, payload.length, stats);

View File

@ -33,7 +33,7 @@ package org.apache.kafka.clients.tools;
* }
* </pre>
*/
public class MessageThroughputThrottler {
public class ThroughputThrottler {
private static final long NS_PER_MS = 1000000L;
private static final long NS_PER_SEC = 1000 * NS_PER_MS;
@ -44,7 +44,7 @@ public class MessageThroughputThrottler {
long targetThroughput = -1;
long startMs;
public MessageThroughputThrottler(long targetThroughput, long startMs) {
public ThroughputThrottler(long targetThroughput, long startMs) {
this.startMs = startMs;
this.targetThroughput = targetThroughput;
this.sleepTimeNs = NS_PER_SEC / targetThroughput;