Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jun 2001 03:47:29 -0400 (EDT)
From:      Chris BeHanna <behanna@zbzoom.net>
To:        FreeBSD-Stable <stable@freebsd.org>
Subject:   Re: Benchmarking CVSup
Message-ID:  <Pine.BSF.4.32.0106160346260.90437-100000@topperwein.dyndns.org>
In-Reply-To: <20010616000523.A6642@anime.net>

next in thread | previous in thread | raw e-mail | index | archive | help
There's probably a better way to do this (e.g., sort the output in
increasing order of hopcount):

#!/usr/bin/perl

$verbose = "false";

if (scalar(@ARGV) > 0) {
    if ($ARGV[0] = "-v") {
        $verbose = "true";
    }
}

if ($verbose eq "false") {
    $devnull = "2>/dev/null";
}

for ($i=1; $i<=16; $i++) {
    $tracecmd = "traceroute -n cvsup$i.freebsd.org $devnull";
    print "$tracecmd\n";

    open(TRACEROUTE, "$tracecmd |") or die "$!\n";

    do {
        $prevline = $line;

        if ($verbose eq "true") {
            print $line;
        }
    }
    while ($line = <TRACEROUTE>);

    close(TRACEROUTE);

    chomp($prevline);

    @tmp = split(' ', $prevline);
    $hops = $tmp[0];

    $mirrors[$i] = $hops;
}

print "\n===== Summary =====\n\n";

for ($i=1; $i<=16; $i++) {
    print "cvsup$i.freebsd.org:  $mirrors[$i] hops\n";
}

-- 
Chris BeHanna
Software Engineer                   (Remove "bogus" before responding.)
behanna@bogus.zbzoom.net
I was raised by a pack of wild corn dogs.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.32.0106160346260.90437-100000>