开发者

GWT:how to measure client performance & info sent to server in case of dealling with hudge data to be showed correctly in the client side dynamically

开发者 https://www.devze.com 2023-03-08 14:44 出处:网络
i m using rpc using event-source, i need to push huge data to the client side and measure the performance and send back the information to the server side for adjusting the delay time(of event source

i m using rpc using event-source, i need to push huge data to the client side and measure the performance and send back the information to the server side for adjusting the delay time(of event source rpc) according to the measured info. How to measure the client performance. How to make buffer in client side so that in client side it can smoothly show the data (eg. array values in graph (x,y) (x1,y1)开发者_如何学JAVA..) and hold some data in its buffer.


What you are basically doing is measuring the network delay and delay of rendering the received data to display. So basically you have two variables here and you have to measure each of them. This is what I'd do:

  1. Client requests data.
  2. Server replies with data and adds a server timestamp to it.
  3. When client finishes receiving data it creates it's own client timestamp with new Date().getTime().
  4. Than client starts rendering received data to the screen.
  5. When done it creates a new timestamp and subtracts previous client timestamp: it gets the rendering time.
  6. The immediately sends another request to server (not a normal data request, but special measuring-only request) and adds rendering time and server timestamp to it. Server gets the data: previous server timestamp and client rendering delay.

Now it can calculate the network delay (current server timestamp - starting server timestamp - rendering delay)/2.

The adjustment delay that you are looking for is network delay + rendering delay.


I guess you are optimizing your code at development phase. In that case, you should use browser tools to measure RPC calls, HTML parsing and CSS rendering like Speed Tracer.

If your issue appears randomly depending of the data loaded on your production system, you have to instrument JavaScript code manually or thanks to the gwt-measure toolkit or dynatrace AJAX.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号