[ 
https://issues.apache.org/jira/browse/KAFKA-1353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13955902#comment-13955902
 ] 

Jun Rao commented on KAFKA-1353:
--------------------------------

For network thread pool, we can do the following. In Processor.run(), we 
measure the time spent in calling selector.select() and the total time in each 
iteration of the while loop. The ratio of the two gives the percentage of 
unused resources.

For the request thread pool, it's a bit tricky since in KafkaRequestHandler, 
requestChannel.receiveRequest() can block forever. What we can do is that in 
requestChannel.receiveRequest(), instead of calling take() on a blocking queue, 
call poll() with a timeout (e.g., 300ms). In KafkaRequestHandler, we can keep 
looping if requestChannel.receiveRequest() returns null. Then we can do the 
same measurement as the above.

> report capacity used by request thread pool and network thread pool
> -------------------------------------------------------------------
>
>                 Key: KAFKA-1353
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1353
>             Project: Kafka
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 0.8.2
>            Reporter: Jun Rao
>
> For monitoring and alerting, it would be very useful for the broker to report 
> the percentage of the request thread pool and network thread pool used. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to