You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nick <fi...@yahoo.com> on 2002/11/16 01:09:03 UTC

timing downloads with mod_perl

I would like to log the time it take users to download
items from my site.  Has anyone has any success
writing a mod perl prog to accomplish this?

Thanks!

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

Re: timing downloads with mod_perl

Posted by Alvar Freude <al...@a-blast.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



- -- Nick <fi...@yahoo.com> wrote:

> I would like to log the time it take users to download
> items from my site.  Has anyone has any success
> writing a mod perl prog to accomplish this?

create two handlers:

  - One in PerlInithandler
  - The second in PerlLogHandler 

(or similar)


Use Time::HiRes to get the time in high resolution

In InitHandler: get the time the request starts.

In LogHandler: look how many time the request took.


But normaly your server's OS caches the output, so this might be only a
hint for big files or the time taken by the request.



For complete HTML pages you can write some JavaScript ...

HTH,
  Alvar


- -- 
** Alvar C.H. Freude
** http://alvar.a-blast.org/   <== NEU!
**
** http://odem.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE92R9lOndlH63J86wRAgjaAJ9RN6BISP5lf0QxFWYj8qLh7en/jQCgzNNE
Qds7SV+WQ/I0giIfi00a8lA=
=brMe
-----END PGP SIGNATURE-----