> submitTimeWrite = (double)System.nanoTime();//catch start time of sending 
> request
> _client.create().inBackground(new Double(time)).forPath(_path + "/" + _count, 
> data);//creade a node in Zookeeper
> endTimeWrite = (double)System.nanoTime();//catch end time of executed request
> latencyInfos.add(""+((endTimeWrite - submitTimeWrite)/1000000)); // add 
> latency per request to array list.

This code snippet is measuring time to enqueue a request to ZooKeeper
client. "endTimeWrite" needs to be set after the operation completes.
Register a listener to the curator client and set endTimeWrite in the
eventReceived callback. It looks like you are already passing the
start time as a context. You can access the start time in the callback
by calling CuratorEvent.getContext().

Reply via email to