Repository: kafka
Updated Branches:
  refs/heads/trunk aa73554c1 -> c30ee50d8


KAFKA-2730: use thread-id as metrics tags

Author: Guozhang Wang <[email protected]>

Reviewers: Gwen Shapira

Closes #416 from guozhangwang/K2730


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

Branch: refs/heads/trunk
Commit: c30ee50d82131ead8bc64223ae5970555b0c78cf
Parents: aa73554
Author: Guozhang Wang <[email protected]>
Authored: Wed Nov 4 10:23:39 2015 -0800
Committer: Gwen Shapira <[email protected]>
Committed: Wed Nov 4 10:23:39 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/server/ReplicaFetcherThread.scala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/c30ee50d/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala 
b/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
index 62c02dd..fad0e3d 100644
--- a/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
+++ b/core/src/main/scala/kafka/server/ReplicaFetcherThread.scala
@@ -65,6 +65,8 @@ class ReplicaFetcherThread(name: String,
 
   private val sourceNode = new Node(sourceBroker.id, sourceBroker.host, 
sourceBroker.port)
 
+  // we need to include the full thread id composed of the broker and the 
thread index
+  // as the metrics tag to avoid metric name conflicts with more than one 
thread to the same broker
   private val networkClient = {
     val selector = new Selector(
       NetworkReceive.UNLIMITED,
@@ -72,7 +74,7 @@ class ReplicaFetcherThread(name: String,
       metrics,
       time,
       "replica-fetcher",
-      Map("broker-id" -> sourceBroker.id.toString).asJava,
+      Map("thread-id" -> name).asJava,
       false,
       ChannelBuilders.create(brokerConfig.interBrokerSecurityProtocol, 
Mode.CLIENT, LoginType.SERVER, brokerConfig.values)
     )

Reply via email to