Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2002 16:33:17 +0100
From:      Daniel Lang <dl@leo.org>
To:        Alexandr Kovalenko <never@nevermind.kiev.ua>
Cc:        Murray Stokely <murray@freebsdmall.com>, hubs@FreeBSD.ORG, re@FreeBSD.ORG
Subject:   Re: 4.7 Download Statistics
Message-ID:  <20021121153317.GG44442@atrbg11.informatik.tu-muenchen.de>
In-Reply-To: <20021111145038.GA54392@nevermind.kiev.ua>
References:  <20021010082732.G1982@freebsdmall.com> <20021010155247.GB20985@atrbg11.informatik.tu-muenchen.de> <20021010090635.K1982@freebsdmall.com> <20021030114453.GA29081@atrbg11.informatik.tu-muenchen.de> <20021111145038.GA54392@nevermind.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Dear Alexandr,

sorry for my late answer, you mail vanished down the stack. :-/

Alexandr Kovalenko wrote on Mon, Nov 11, 2002 at 04:50:38PM +0200:
[..]
> > I finally can come up with some statistics:
> What ftpd are you using?
> If stock ftpd, could you please supply a script to calculate those stats? :)
I use proftpd, not the stock one. 

The script is dead simple. I just grep the RETR lines from the 
xferlog with the directory/section (e.g. FreeBSD) and count the
byte-fields:

#!/usr/bin/perl -w
#
# $Id$
#
# Small script to count the lines and sum up the
# bytes of the fed-in input lines
# must be in "leolog" format
#
use strict;

my $count = 0;
my $bytes = 0;

while(<STDIN>) {

  if(/RETR\s+.*\s\(\"RETR .*\"\) took .* for (\d+) bytes/) {
    ++$count;
    $bytes += $1;
  }
}

my $mbytes = $bytes / 1024.0 / 1024.0;
my $gbytes = $mbytes / 1024.0;

printf "Count: $count\nBytes: $bytes\nMBytes: %.2f\nGBytes: %.2f\n",
       $mbytes, $gbytes;
__END__

-- 
IRCnet: Mr-Spock         - "I hear that, if you play the WindowsXP CD
                                backwards, you get a Satanic message!"
    - "That's nothing. If you play it forward, it installs WindowsXP!"
 Daniel Lang * dl@leo.org * +49 89 289 18532 * http://www.leo.org/~dl/

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021121153317.GG44442>