OK, here's the bit that does the measuring. I'm not showing the cgi-script that does the display - I'm too embarassed and don't have the time to make it suitable for public consumption. I do have a little bit of hubris, (and laziness in spades) :-) But if you *really* want it leave your email. perlcgi.
#!/usr/local/bin/perl -w # Written, as quick 'n dirty hack - so here it is warts and all. # This just retrieves a hash of sites and times how long for each page # to download. Writes timing for each site to tab delimited file/stdou +t. use strict; use LWP::Simple; # I know, better to use UserAgent use Time::HiRes qw(gettimeofday); # Accuracy overkill, maybe? my $thisrun=localtime(time); # When the data was collected #Amend the next line as required or just leave it out #open(OPFILE, ">>/var/logs/whatever") || die "Could not open/var/logs/ +whatever:$!"; # Hash of sites to be timed my %url = (pubmed =>"http://www.ncbi.nlm.nih.gov", proquest =>"http://proquest.umi.com", JSTOR => "http://www.jstor.ac.uk/jstor/", AMAZONUK => "http://www.amazon.co.uk/", AMAZONUS => "http://www.amazon.com/", SPRR => "http://sprr.library.nuigalway.ie", SCIDIR => "http://www.sciencedirect.com/" ); sub process_url { my $url = shift; my $now_time = gettimeofday; my $page = get($url); my $elapsed_time = gettimeofday-$now_time; # print "Site:$url\tTime Taken:$elapsed_time\t Run on $thisrun\n"; # print OPFILE "$url\t$elapsed_time \t$thisrun\n"; } foreach my $key (sort keys %url) { &process_url($url{$key}) } # That's it!

In reply to RE: RE: RE: RE: RE: Distributed network monitor by perlcgi
in thread Distributed network monitor by comatose

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.