org.zkoss.zkdemo.test
Class PerformanceMeter

java.lang.Object
  extended by org.zkoss.zkdemo.test.PerformanceMeter
All Implemented Interfaces:
PerformanceMeter

public class PerformanceMeter
extends java.lang.Object
implements PerformanceMeter

A simple performance meter.

Author:
tomyeh

Constructor Summary
PerformanceMeter()
           
 
Method Summary
 void requestCompleteAtClient(java.lang.String requestId, Execution exec, long time)
          Called to notify when the client has completed the processing of the response.
 void requestCompleteAtServer(java.lang.String requestId, Execution exec, long time)
          Called to notify when the server has completed the processing of the request.
 void requestReceiveAtClient(java.lang.String requestId, Execution exec, long time)
          Called to notify when the client has received the response (but not processed yet).
 void requestStartAtClient(java.lang.String requestId, Execution exec, long time)
          Called to notify when the client starts to send the request to server.
 void requestStartAtServer(java.lang.String requestId, Execution exec, long time)
          Called to notify when the server receives the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerformanceMeter

public PerformanceMeter()
Method Detail

requestStartAtClient

public void requestStartAtClient(java.lang.String requestId,
                                 Execution exec,
                                 long time)
Description copied from interface: PerformanceMeter
Called to notify when the client starts to send the request to server.

Specified by:
requestStartAtClient in interface PerformanceMeter
Parameters:
requestId - a desktop-wide unique ID to identify a request. Note: it is not the same as ExecutionCtrl.getRequestId()
exec - the execution. You can retrieve the desktop, session and user's info from it. But, don't access the component in this method since it is not safe (exec is not activated).
time - the time representing the number of milliseconds between midnight January 1, 1970 (UTC) to when the client starts the request. It is client's time, not server's.

requestReceiveAtClient

public void requestReceiveAtClient(java.lang.String requestId,
                                   Execution exec,
                                   long time)
Description copied from interface: PerformanceMeter
Called to notify when the client has received the response (but not processed yet).

Note: the invocation of this method doesn't take place immediately. Rather it is piggyback when the client is sending another request. It also means that this method might not be called for each request (due to no further request).

Note to version prior to 3.0.8:
This method is introduced since 3.0.8. Prior to 3.0.8, PerformanceMeter.requestCompleteAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long) is actually the time when the client recieved the response rather than when the response has been processed.

Specified by:
requestReceiveAtClient in interface PerformanceMeter
Parameters:
requestId - a desktop-wide unique ID to identify a request. If PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long) was called, it is the same as the request ID that was passed to PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long), If not called, it is the desktop's ID.
exec - the execution. You can retrieve the desktop, session and user's info from it. But, don't access the component in this method since it is not safe (exec is not activated).
time - the time representing the number of milliseconds between midnight January 1, 1970 (UTC) to when the client has completed the process. It is client's time, not server's.

requestCompleteAtClient

public void requestCompleteAtClient(java.lang.String requestId,
                                    Execution exec,
                                    long time)
Description copied from interface: PerformanceMeter
Called to notify when the client has completed the processing of the response.

Note: the invocation of this method doesn't take place immediately. Rather it is piggyback when the client is sending another request. It also means that this method might not be called for each request (due to no further request).

Specified by:
requestCompleteAtClient in interface PerformanceMeter
Parameters:
requestId - a desktop-wide unique ID to identify a request. If PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long) was called, it is the same as the request ID that was passed to PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long), If not called, it is the desktop's ID.
exec - the execution. You can retrieve the desktop, session and user's info from it. But, don't access the component in this method since it is not safe (exec is not activated).
time - the time representing the number of milliseconds between midnight January 1, 1970 (UTC) to when the client has completed the process. It is client's time, not server's.

requestStartAtServer

public void requestStartAtServer(java.lang.String requestId,
                                 Execution exec,
                                 long time)
Description copied from interface: PerformanceMeter
Called to notify when the server receives the request.

Specified by:
requestStartAtServer in interface PerformanceMeter
Parameters:
requestId - a desktop-wide unique ID to identify a request. If PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long) was called, it is the same as the request ID that was passed to PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long), If not called, it is the desktop's ID.
exec - the execution. You can retrieve the desktop, session and user's info from it. But, don't access the component in this method since it is not safe (exec is not activated).
time - the time representing the number of milliseconds between midnight January 1, 1970 (UTC) to when the server receives the request. It is server's time.

requestCompleteAtServer

public void requestCompleteAtServer(java.lang.String requestId,
                                    Execution exec,
                                    long time)
Description copied from interface: PerformanceMeter
Called to notify when the server has completed the processing of the request.

Specified by:
requestCompleteAtServer in interface PerformanceMeter
Parameters:
requestId - a desktop-wide unique ID to identify a request. If PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long) was called, it is the same as the request ID that was passed to PerformanceMeter.requestStartAtClient(java.lang.String, org.zkoss.zk.ui.Execution, long), If not called, it is the desktop's ID.
exec - the execution. You can retrieve the desktop, session and user's info from it. But, don't access the component in this method since it is not safe (exec is not activated).
time - the time representing the number of milliseconds between midnight January 1, 1970 (UTC) to when the server has completed the process. It is server's time.


Copyright © 2005-2009 Potix Corporation. All Rights Reserved.