Measuring performance of Net::FTP

  • Thread starter Carlo Filippini
  • Start date
C

Carlo Filippini

Hi
I am trying to measure the perofrmance of a wireless link using
maily ftp. Unfortunately get and put from Net::FTP do not give me an
measure of the performances. I am sure somebody must have done this
already. I just need a DOS like "xxxx bytes transferred in xxx
seconds", should be quite simple...

Any suggestion?
Thanks
Carlo
 
P

Philip

one way to do it is like so (untested):
-----
my $file = "foo.txt";
my $size = -s $file;
my $done = 0;
my $time = time();

my $upload = $ftp->send($file);

open (FILE, $file);
while (my $line = <FILE>) {
my $length = length($line);
$upload->write($line, $length);
$done += $length;
if ($done == $size) {
$upload->close;
}
}
close;

my $total = time() - $time;

print "$done bytes uploaded in $total seconds";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top