3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /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
3 Einträge, 1 Seite |