----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/20034/#review39792 -----------------------------------------------------------
The way that we expose the metrics through a gauge is a bit complicated. I think a simpler solution is to do this through a meter. Note that meter is just the total record values divided by a time window. If we record each absolute utilization time in each loop, the value the meter calculates essentially gives us the utilization ratio. One problem is that meter.record only takes a long so we have to be careful not to lose precision. What we can do is to configure a meter to use the nano-sec granularity. We then record absolute utilization time / # thread. This gives us the avg utilization ratio for the threadpool. It shouldn't lose precision since it's measured in nano-secs. For the network threadpool, in addition to the avg for the threadpool, it may be useful to report the utilization at per thread level too. core/src/main/scala/kafka/network/RequestChannel.scala <https://reviews.apache.org/r/20034/#comment72387> Do we still need this? core/src/main/scala/kafka/network/SocketServer.scala <https://reviews.apache.org/r/20034/#comment72385> We need to measure this in nano sec. Millsec is to coarse a granularity to measure a tight loop. core/src/main/scala/kafka/network/SocketServer.scala <https://reviews.apache.org/r/20034/#comment72386> Idle time should just be the time in doing socket select. - Jun Rao On April 4, 2014, 5:44 p.m., Guozhang Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/20034/ > ----------------------------------------------------------- > > (Updated April 4, 2014, 5:44 p.m.) > > > Review request for kafka. > > > Bugs: KAFKA-1353 > https://issues.apache.org/jira/browse/KAFKA-1353 > > > Repository: kafka > > > Description > ------- > > KAFKA-1353.v1 > > > Diffs > ----- > > core/src/main/scala/kafka/network/RequestChannel.scala > a6ec970d72fc8adc56bc6e200d1ff5bbf0d2b748 > core/src/main/scala/kafka/network/SocketServer.scala > dcfca3f4156957b0006ba9bfdeca848c115825a8 > core/src/main/scala/kafka/server/KafkaRequestHandler.scala > 871212bf9110ca95ca7d2109be070f69d0f90247 > > Diff: https://reviews.apache.org/r/20034/diff/ > > > Testing > ------- > > > Thanks, > > Guozhang Wang > >
