Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to measure time for the transfer of image sets

Status
Not open for further replies.

Behruz

Programmer
May 12, 2007
5
AU
Hi,

i need to write a script to measure the time it takes to transfer large image sets between 2 PCs. i have set up two PCs both on Linux (fedora 6) connected together by a crossover cable. one is acting as a web server and the aim is to transfer a set of images using different protocols (FTP, HTTP ...)and see which works the fastest and by how much. what do you guys recon is the best way of doing this? what language should i use?

Cheers.
 
Hi

Code:
time wget -q --delete-after [URL unfurl="true"]http://example.com/image.png[/URL]

time wget -q --delete-after ftp://example.com/image.png

[gray]# then compare the elapsed times with your eyes[/gray]

Feherke.
 
would something like this work to calculate the time it takes to transfer an image from one PC to another?

#! perl -w
use strict;

use Net::FTP;
use Time::HiRes qw(gettimeofday tv_interval);

my $ftp = Net::FTP->new("train1", Debug =>0) or die "Cannot connect to some.host.name: $@;

$ftp->login("IT",'itadmin') or die "Cannot login ", $ftp->message;
my $return = $ftp->site('binary');
print "return = $return\n";

for (my $1 = 0; $i < 10; $i++) {
my $t0 = [gettimeofday];

$ftp->get("testfile") or die "get failed", $ftp->message;
my $t1 = [gettimeofday];

my $elapsed = tv_interval ($t0, $t1);

print $elapsed. "\n";
}
$ftp->quite;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top