You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by jg...@apache.org on 2022/05/18 18:31:22 UTC

[kafka] branch trunk updated: MINOR: Replace string literal with constant in RequestChannel (#12134)

This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new cf34a2e4b0 MINOR: Replace string literal with constant in RequestChannel (#12134)
cf34a2e4b0 is described below

commit cf34a2e4b083ae0b6fe43bee720d9347c0e18b86
Author: runom <je...@gmail.com>
AuthorDate: Thu May 19 03:31:15 2022 +0900

    MINOR: Replace string literal with constant in RequestChannel (#12134)
    
    Replace the "RequestsPerSec" literal value with the pre-existing constant `RequestsPerSec`.
    
    Reviewers: Divij Vaidya <di...@gmail.com>, Jason Gustafson <ja...@confluent.io>
---
 core/src/main/scala/kafka/network/RequestChannel.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/kafka/network/RequestChannel.scala b/core/src/main/scala/kafka/network/RequestChannel.scala
index 07da59c5f2..4fa611206a 100644
--- a/core/src/main/scala/kafka/network/RequestChannel.scala
+++ b/core/src/main/scala/kafka/network/RequestChannel.scala
@@ -530,7 +530,7 @@ class RequestMetrics(name: String) extends KafkaMetricsGroup {
   Errors.values.foreach(error => errorMeters.put(error, new ErrorMeter(name, error)))
 
   def requestRate(version: Short): Meter = {
-    requestRateInternal.getAndMaybePut(version, newMeter("RequestsPerSec", "requests", TimeUnit.SECONDS, tags + ("version" -> version.toString)))
+    requestRateInternal.getAndMaybePut(version, newMeter(RequestsPerSec, "requests", TimeUnit.SECONDS, tags + ("version" -> version.toString)))
   }
 
   class ErrorMeter(name: String, error: Errors) {