java - How to measure the performance of Action Classes? -


how measure performance of action classes of struts 1.2 application?

i looking way collect performance statistics on how long each action took.any idea if can done? piece of code appreciated?

easy , pure-java ee option: can set filter in front of struts servlet (struts 1) hands control, stopwatches execution time. doc on filters:

http://www.oracle.com/technetwork/java/filters-137243.html

aspect oriented solutions:

if applications packs spring framework, can same thing in fine grain scale setting aspect measures execution time of each service/dao/etc.

instrumenting classes in spring: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/overview.html

and, if want set aspect straight on action classes, can set agent class in jvm startup (always if operations people allow you) , instrument them. here example of diy instrumented performance reporter:

http://chimpler.wordpress.com/2013/11/05/implementing-a-java-agent-to-instrument-code/

please note bit -javaagent swith jvm must in startup of application server - may have give sound arguments operations people, when propose change production environment config


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -