kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-2360; Extract producer-specific configs out of the common PerfConfig
Date Tue, 08 Aug 2017 22:23:24 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 98d4a4833 -> 649276abb


KAFKA-2360; Extract producer-specific configs out of the common PerfConfig

Separate `batch.size`, `message-size` and `compression-code` from PerfConfig to a newly-created
ProducerPerfConfig in order to hide them in ConsumerPerf tool.

Author: huxihx <huxi_2b@hotmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3613 from huxihx/KAFKA-2360


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/649276ab
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/649276ab
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/649276ab

Branch: refs/heads/trunk
Commit: 649276abb284c4f71504e9f028c5ab1450849fae
Parents: 98d4a48
Author: huxihx <huxi_2b@hotmail.com>
Authored: Tue Aug 8 23:22:57 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Tue Aug 8 23:22:57 2017 +0100

----------------------------------------------------------------------
 .../scala/kafka/tools/ConsumerPerformance.scala    |  2 ++
 core/src/main/scala/kafka/tools/PerfConfig.scala   | 17 -----------------
 .../scala/kafka/tools/ProducerPerformance.scala    | 15 +++++++++++++++
 .../kafka/tools/SimpleConsumerPerformance.scala    |  2 ++
 4 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/649276ab/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ConsumerPerformance.scala b/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
index 2880c94..ed1b440 100644
--- a/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
+++ b/core/src/main/scala/kafka/tools/ConsumerPerformance.scala
@@ -240,6 +240,8 @@ object ConsumerPerformance {
       .describedAs("config file")
       .ofType(classOf[String])
     val printMetricsOpt = parser.accepts("print-metrics", "Print out the metrics. This only
applies to new consumer.")
+    val showDetailedStatsOpt = parser.accepts("show-detailed-stats", "If set, stats are reported
for each reporting " +
+      "interval as configured by reporting-interval")
 
     val options = parser.parse(args: _*)
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/649276ab/core/src/main/scala/kafka/tools/PerfConfig.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/PerfConfig.scala b/core/src/main/scala/kafka/tools/PerfConfig.scala
index a285a1c..264ae6a 100644
--- a/core/src/main/scala/kafka/tools/PerfConfig.scala
+++ b/core/src/main/scala/kafka/tools/PerfConfig.scala
@@ -37,23 +37,6 @@ class PerfConfig(args: Array[String]) {
     .describedAs("date format")
     .ofType(classOf[String])
     .defaultsTo("yyyy-MM-dd HH:mm:ss:SSS")
-  val showDetailedStatsOpt = parser.accepts("show-detailed-stats", "If set, stats are reported
for each reporting " +
-    "interval as configured by reporting-interval")
   val hideHeaderOpt = parser.accepts("hide-header", "If set, skips printing the header for
the stats ")
-  val messageSizeOpt = parser.accepts("message-size", "The size of each message.")
-    .withRequiredArg
-    .describedAs("size")
-    .ofType(classOf[java.lang.Integer])
-    .defaultsTo(100)
-  val batchSizeOpt = parser.accepts("batch-size", "Number of messages to write in a single
batch.")
-    .withRequiredArg
-    .describedAs("size")
-    .ofType(classOf[java.lang.Integer])
-    .defaultsTo(200)
-  val compressionCodecOpt = parser.accepts("compression-codec", "If set, messages are sent
compressed")
-    .withRequiredArg
-    .describedAs("supported codec: NoCompressionCodec as 0, GZIPCompressionCodec as 1, SnappyCompressionCodec
as 2, LZ4CompressionCodec as 3")
-    .ofType(classOf[java.lang.Integer])
-    .defaultsTo(0)
   val helpOpt = parser.accepts("help", "Print usage.")
 }

http://git-wip-us.apache.org/repos/asf/kafka/blob/649276ab/core/src/main/scala/kafka/tools/ProducerPerformance.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ProducerPerformance.scala b/core/src/main/scala/kafka/tools/ProducerPerformance.scala
index f14253b..0f21831 100644
--- a/core/src/main/scala/kafka/tools/ProducerPerformance.scala
+++ b/core/src/main/scala/kafka/tools/ProducerPerformance.scala
@@ -125,6 +125,21 @@ object ProducerPerformance extends Logging {
       .describedAs("metrics directory")
       .ofType(classOf[java.lang.String])
     val useNewProducerOpt = parser.accepts("new-producer", "Use the new producer implementation.")
+    val messageSizeOpt = parser.accepts("message-size", "The size of each message.")
+      .withRequiredArg
+      .describedAs("size")
+      .ofType(classOf[java.lang.Integer])
+      .defaultsTo(100)
+    val batchSizeOpt = parser.accepts("batch-size", "Number of messages to write in a single
batch.")
+      .withRequiredArg
+      .describedAs("size")
+      .ofType(classOf[java.lang.Integer])
+      .defaultsTo(200)
+    val compressionCodecOpt = parser.accepts("compression-codec", "If set, messages are sent
compressed")
+      .withRequiredArg
+      .describedAs("supported codec: NoCompressionCodec as 0, GZIPCompressionCodec as 1,
SnappyCompressionCodec as 2, LZ4CompressionCodec as 3")
+      .ofType(classOf[java.lang.Integer])
+      .defaultsTo(0)
 
     val options = parser.parse(args: _*)
     CommandLineUtils.checkRequiredArgs(parser, options, topicsOpt, brokerListOpt, numMessagesOpt)

http://git-wip-us.apache.org/repos/asf/kafka/blob/649276ab/core/src/main/scala/kafka/tools/SimpleConsumerPerformance.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/SimpleConsumerPerformance.scala b/core/src/main/scala/kafka/tools/SimpleConsumerPerformance.scala
index f5d64b4..1d090b3 100644
--- a/core/src/main/scala/kafka/tools/SimpleConsumerPerformance.scala
+++ b/core/src/main/scala/kafka/tools/SimpleConsumerPerformance.scala
@@ -145,6 +145,8 @@ object SimpleConsumerPerformance {
                            .describedAs("clientId")
                            .ofType(classOf[String])
                            .defaultsTo("SimpleConsumerPerformanceClient")
+    val showDetailedStatsOpt = parser.accepts("show-detailed-stats", "If set, stats are reported
for each reporting " +
+      "interval as configured by reporting-interval")
 
     val options = parser.parse(args : _*)
 


Mime
View raw message