Performance Monitoring"

From Documentation
 
(5 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
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.
 
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.
  
* <javadoc type="interface">org.zkoss.zk.ui.util.PerformanceMeter</javadoc>: Monitoring the performance from network speed, server-processing time and the client-rendering time.
+
* <javadoc type="interface">org.zkoss.zk.ui.util.PerformanceMeter</javadoc>: Monitoring the performance from the network speed, server-processing time and the client-rendering time.
 
* <javadoc type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc>: Monitoring the performance of each event listener.
 
* <javadoc type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc>: Monitoring the performance of each event listener.
 
* <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 [https://visualvm.github.io/ VisualVM] and [http://www.ej-technologies.com/products/jprofiler/overview.html JProfiler]. They can provide more insightful view of your application.
  
=Event Interceptors=
+
{{ZKDevelopersReferenceHeadingToc}}
 
 
Though <javadoc type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> 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 <javadoc method="beforeProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc> and <javadoc method="afterProcessEvent(org.zkoss.zk.ui.event.Event)" type="interface">org.zkoss.zk.ui.util.EventInterceptor</javadoc>
 
 
 
Once implemented, you could register it by specifying the following in <tt>WEB-INF/zk.xml</tt> (assume the class is called foo.MyEventMeter):
 
 
 
<source lang="xml">
 
<zk>
 
    <listener>
 
        <listener-class>foo.MyEventMeter</listener-class>
 
    </listener>
 
</zk>
 
</source>
 
 
 
=Loading Monitors=
 
 
 
To know the loading of an application, you could implement <javadoc type="interface">org.zkoss.zk.ui.util.Monitor</javadoc> to count the number of desktops, sessions and requests.
 
 
 
Once implemented, you could register it by specifying the following in <tt>WEB-INF/zk.xml</tt> (assume the class is called foo.MyStatistic):
 
 
 
<source lang="xml">
 
<zk>
 
    <listener>
 
        <listener-class>foo.MyStatistic</listener-class>
 
    </listener>
 
</zk>
 
</source>
 
 
 
=Sample Implementations=
 
  
 
For sample implementations, you might take a look at the following articles:
 
For sample implementations, you might take a look at the following articles:
Line 45: Line 17:
 
* [[Small Talks/2010/January/A ZK Performance Monitor|A ZK Performance Monitor]]
 
* [[Small Talks/2010/January/A ZK Performance Monitor|A ZK Performance Monitor]]
 
* [[Small Talks/2010/April/Real-time Performance Monitoring of Ajax Event Handlers|Real-time Performance Monitoring of Ajax Event Handlers]]
 
* [[Small Talks/2010/April/Real-time Performance Monitoring of Ajax Event Handlers|Real-time Performance Monitoring of Ajax Event Handlers]]
 
=Version History=
 
{{LastUpdated}}
 
{| border='1px' | width="100%"
 
! Version !! Date !! Content
 
|-
 
| &nbsp;
 
| &nbsp;
 
| &nbsp;
 
|}
 
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 07:08, 11 November 2020


Performance Monitoring



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 the 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 can provide more insightful view of your application.



For sample implementations, you might take a look at the following articles:



Last Update : 2020/11/11

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.