• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Logging response times

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a struts based web application. I need to determine the time spent by a user on each page of the application. This is so I can create a report for each customer who browses through my application with the time he spends on each page. Currently I am planning to extend ActionServlet and include log statements that log start and end of each request as well as the users session id(to nuiquely identify a customer) Is there a standard/better way of doing this?

Thanks
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally the time your server takes to process a request, from start to finish, should be only a few seconds. Now, if I were a user of your system and you told me that I spent 1.377 seconds on page X, I would be bemused, because after your server showed me page X I actually looked at it for a couple of minutes before I clicked on the link to page Y.

So I think you need to clarify what time it is that you are trying to measure.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It will be tough. You can probably implement some code that will track the time between when a page is shown and when the user clicks a button or link on that page. You won't be able to measure how much of that time the user spent actually looking at the page versus getting a cup of coffee, answering a phone call or the such. Also what if the user never clicks on a link or button?

I know that there are third party products that try and produce these types of metrics. If you needs are sophisticated I would suggest you purchase such a product. If you need something very simple then your general approach seems good (though using a database seems better than a log file).

- Brent
 
Cindy Jones
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hiThanks for your responses.
i think my question did not make the actual purpose clear. what i want done is to know how much time i spent serving the different pages to the customers and to track each user session. This is so I know what a particular customer tried to do or when he was actually made to wait a long time.
Currently what I have done is this:
Extended ActionServlet. In this when the request from the first page comes in I create a cookie using System.currrentTime. On each subsequent request that comes in I log the requested uri as well as the cookie value, the start and end time of the request and any other info I have of the customer. This way I know what requests were made by a particular customer and what time he had to waif after each request.
Please let me know if there is a better way to do this.
Thanks,
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic