Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using JAMON  RSS feed

 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i use JAMon in my struts application .How can i do that?please help.Also i have placed the war file in my tomcat how can i see the out of my test in the JSP file.can anyone provide me with a small sample.

Thanks
Abhilash
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the documentation? It's pretty straightforward.

Basically you start the monitor when you want to start tracking:


Then you stop the monitor when you want to stop tracking:


If you are using Struts 2, this is a good place to use an Interceptor.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without changing your code you can monitor any pages on your tomcat server with JAMon by following these simple stepsl

http://jamonapi.sourceforge.net/http_monitoring.html#intro

To view the statistics then use this url (from installing the jamon war file): http://host:port/jamon/jamonadmin.jsp

This will get you started. If later you want to use a struts interceptor you could monitor with that approach.
 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai joe ,steve

Thanks for the replies.My application is a struts application. so i have edited server.xml file and have placed jamon-2.7.jar at correct location.

My doubt is that do i need to do this step

Add the appropriate servlet filter (com.jamonapi.http.JAMonServletFilter) to he applications web.xml file

Should i use a struts request interceptor directly.what steps should i follow to monitor a struts application.?

Thanks
Abhilash
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
follow the steps in the link i gave. if you have any questions after you do these steps ask them then. you don't need a servlet filter if you use a valve.
 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai steve ,

Thanks for the reply.I followed the steps as you said.But i added a code

Monitor userInfo=MonitorFactory.start("Login_Page_hits-"); in my Login page and i could see the corresponding label in the report.

I find that if i uses a servlet filter all files in this web application will get monitored.But my application is a struts application .SO my doubt is that

there requires some code change like this ie atleast to call the start method to invoke monitor rite?If i am wrong how can i monitor all files in a struts application , all session etc. with out a code change.

Thanks
Abhi
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not familiar with Struts. Do you want to measure the performance of events, or page executions? Does Struts have the concept of an interceptor or AOP? If so that would be the place to code a couple calls to jamon.
 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks steve for the prompt reply
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!