You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "squah-confluent (via GitHub)" <gi...@apache.org> on 2025/02/17 16:33:44 UTC

[PR] KAFKA-18807; Fix thread idle ratio metric [kafka]

squah-confluent opened a new pull request, #18934:
URL: https://github.com/apache/kafka/pull/18934

   When group.coordinator.threads is greater than 1, we lose track of
   thread idle time because of integer arithmetic. Use doubles instead.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18807; Fix thread idle ratio metric [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #18934:
URL: https://github.com/apache/kafka/pull/18934


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18807; Fix thread idle ratio metric [kafka]

Posted by "squah-confluent (via GitHub)" <gi...@apache.org>.
squah-confluent commented on code in PR #18934:
URL: https://github.com/apache/kafka/pull/18934#discussion_r1958519491


##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeMetrics.java:
##########
@@ -71,7 +71,7 @@ public interface CoordinatorRuntimeMetrics extends AutoCloseable {
      * Record the thread idle time.
      * @param idleTimeMs The idle time in milliseconds.
      */
-    void recordThreadIdleTime(long idleTimeMs);
+    void recordThreadIdleTime(double idleTimeMs);

Review Comment:
   It looks a bit strange to have this particular metric accept a double while all the other metrics accept a long.
   
   But I don't think we should change the other metrics to accept doubles, since they're strictly durations. This one is a little different and normalized by the number of threads.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-18807; Fix thread idle ratio metric [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #18934:
URL: https://github.com/apache/kafka/pull/18934#discussion_r1958527263


##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeMetrics.java:
##########
@@ -71,7 +71,7 @@ public interface CoordinatorRuntimeMetrics extends AutoCloseable {
      * Record the thread idle time.
      * @param idleTimeMs The idle time in milliseconds.
      */
-    void recordThreadIdleTime(long idleTimeMs);
+    void recordThreadIdleTime(double idleTimeMs);

Review Comment:
   I think that it is fine.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org