Performance Monitoring"
Line 9: | Line 9: | ||
* <javadoc type="interface">org.zkoss.zk.ui.util.Monitor</javadoc>: Monitoring the number of desktops, sessions and other system load. | * <javadoc type="interface">org.zkoss.zk.ui.util.Monitor</javadoc>: Monitoring the number of desktops, sessions and other system load. | ||
* There are a lot of performance monitor tools, such as [http://visualvm.dev.java.net/ VisualVM] and [http://www.ej-technologies.com/products/jprofiler/overview.html JProfiler]. They could provide more insightful view of your application. | * There are a lot of performance monitor tools, such as [http://visualvm.dev.java.net/ VisualVM] and [http://www.ej-technologies.com/products/jprofiler/overview.html JProfiler]. They could provide more insightful view of your application. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=Event Interceptors= | =Event Interceptors= |
Revision as of 08:38, 29 November 2010
To improve the performance of an Ajax application, it is better to monitor the performance for identifying the bottleneck. Depending on the information you'd like to know, there are a few approaches.
- PerformanceMeter: Monitoring the performance from network speed, server-processing time and the client-rendering time.
- EventInterceptor: Monitoring the performance of each event listener.
- Monitor: Monitoring the number of desktops, sessions and other system load.
- There are a lot of performance monitor tools, such as VisualVM and JProfiler. They could provide more insightful view of your application.
Event Interceptors
Though EventInterceptor is designed to allow developer to intercept how an event is processed, you could use it as callback to know how long it takes to process an event. The event processing time can be calculated by subtracting the time between EventInterceptor.beforeProcessEvent(Event) and EventInterceptor.afterProcessEvent(Event)
Once implemented, you could register it by specifying the following in WEB-INF/zk.xml (assume the class is called foo.MyEventMeter):
<zk>
<listener>
<listener-class>foo.MyEventMeter</listener-class>
</listener>
</zk>
Loading Monitors
To know the loading of an application, you could implement Monitor to count the number of desktops, sessions and requests.
Once implemented, you could register it by specifying the following in WEB-INF/zk.xml (assume the class is called foo.MyStatistic):
<zk>
<listener>
<listener-class>foo.MyStatistic</listener-class>
</listener>
</zk>
Sample Implementations
For sample implementations, you might take a look at the following articles:
- Performance Monitoring of ZK Applicaiton
- A ZK Performance Monitor
- Real-time Performance Monitoring of Ajax Event Handlers
Version History
Version | Date | Content |
---|---|---|