#! /usr/bin/perl use warnings; use strict; use LWP::Simple; use Time::HiRes qw(time); my $calls = 4; #my $server = "http://strat:8084/"; my $server = "http://develop.perl-community.de/"; # startseite &FireCalls("$server", $calls); # boards; da kommt manchmal fehler, was ok ist foreach (1..10) { &FireCalls("$server/board/$_/", $calls); } # foreach # threads foreach (1..100) { &FireCalls("$server/thread/$_/", $calls); } # foreach # Beitraege der letzten "24" Stunden &FireCalls("$server/cgi-bin/board.pl?action=last24hours", $calls); sub FireCalls { my ($url, $calls) = @_; print "Trying url $url\n"; my $start = time; for (0..$calls) { my $content = get("$url"); unless ($content) { print "$_ failed\t"; } else { print "."; } } # for print "\nTimeAverage for '$url': ", (time - $start) / $calls, "\n"; } # FireCalls