Hi, I am going to extend the metrics with the following information, soon - when I am @home:
* Component new onInitialize onDetach onConfigure * ResourceReference new * AjaxRequestTarget add kind regards Tobias > Am 11.03.2016 um 08:41 schrieb Francois Meillet <[email protected]>: > > Thanks Tobias ! > > Very good. > > François > > > > > > > > >> Le 10 mars 2016 à 21:39, Tobias Soloschenko >> <[email protected]> a écrit : >> >> Hi all, >> >> I just want to discuss a new module I would like to see in Wicket. It is >> mentioned in the list of ideas in Confluence for Wicket 8: >> >> https://cwiki.apache.org/confluence/display/WICKET/Ideas+for+Wicket+8.0 >> >> The Module is going to provide metrics to see how often requests have been >> handled from a webapp, how many render calls have been processed and other >> metrics: >> >> https://github.com/klopfdreh/wicket/tree/wicket_metrics >> >> I used the framework mentioned in the Confluence article and did a lot of >> research not to create a big performance and code impact because of changing >> every class in Wicket Core. >> >> As you can see in the commits I used AspectJ. To get the Code working for >> you, you have to do the following steps: >> >> 1. Fetch the branch https://github.com/klopfdreh/wicket/tree/wicket_metrics >> >> 2. Just drop the jars of aspectjrt and aspectjweaver into the tomcat 8 lib >> folder >> http://mvnrepository.com/artifact/org.aspectj/aspectjrt/1.8.8 >> http://mvnrepository.com/artifact/org.aspectj/aspectjweaver/1.8.8 >> >> 4. Add the java agent to the jvm start options: >> -javaagent:/pathToServer/lib/aspectjweaver-1.8.8.jar >> >> the metrics dependency is shipped with the project >> >> 5. Add the maven dependency wicket-metrics to your project (and install the >> snapshot locally before) and write WicketMetrics.startJmxReporter(); in your >> applications init(); >> >> 6. Do a request to your project >> >> 7. Open jvisualvm and the tomcat process and have a look at metrics mbeans >> (mbean plugin has to be installed) >> >>>>>> So now the reason why I used Aspectj: >> >> 1. The metrics code does not pull down the performance because of a lot of >> additional method invocations if not needed >> >> 2. If the metrics project is not resolved Wicket acts like nothing changed >> >> 3. Because of aspects also components written by the developers are also >> measured. So if a component extends Component the render method and the >> constructor calls are measured (for example). The developer dont have to >> take care of the statistics (See example) >> >> 4. It is clearly visible which Aspect is providing metrics about a component >> and you dont have to dig through the whole Wicket Code to find the >> measurement implementations >> >> 5. If there is an error in the statistics they can be turned off easily >> >> Example class: >> https://github.com/klopfdreh/wicket/blob/wicket_metrics/wicket-metrics/src/main/java/org/apache/wicket/metrics/aspects/ComponentAspect.java >> >> In my opinion this is the right way to implement it - even if this means to >> do a little setup before. (jvm-parameter,copy jars) >> >> Just try it out and let me know what are the results! :-) >> >> kind regards >> >> Tobias >
