Hi Alen

AvgRequestLatency 0 implies that on an average time taken by the server to
serve a request is less than one milli second. May be it is really 0 or it
may be 0.99 ms.

This behaviour is not specific to 3.4.7 and 3.4.9 version but the same
behaviour is there in all versions

I find two reason whys AvgRequestLatency is almost all the time 0

1) Ping requests are counted the most:

AvgRequestLatency is calculated as

AvgRequestLatency=totalLatency/count

Ping requests come very often and complete very fast, these request add
nothing to totalLatency but add one to count.

2) Wrong data type is chosen to store AvgRequestLatency:

AvgRequestLatency is calculated and store as the long value instead of
double vlaue.



In my opinion ZooKeeper code should be modified to improve this metrics

i) Ping request should be ignored while recording the statistics or at
least should be configurable whether to ignore or not. If ping request is
not counted even other metrics will be more meaningful.

ii)  AvgRequestLatency should be of double type.



-Arshad

On Thu, Dec 1, 2016 at 4:50 AM, allen chan <allen.michael.c...@gmail.com>
wrote:

> Anyone seeing this issue? I am experiencing it on 3.4.7 and 3.4.9
>
> JMX metric name: AvgRequestLatency
> JMX Location:
> org.apache.ZooKeeperService:name0=ReplicatedServer_id#,
> name1=replica.#,name2=[Leader|Follower]:AvgRequestLatency
>
> It always has a value of zero. The MaxRequestLatency is non-zero and
> changes while the AvgRequestLatency always is zero.
>
> The zk_avg_latency metric in mntr is also zero. Is this metric not tracked
> anymore?
>
> Thanks
> --
> Allen Michael Chan
>

Reply via email to