mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 07:53:31 +01:00
benchmark.pl: Improve help text, add Makefile target
Performing a benchmark on /var/tmp now is as easy as "make benchmark".
This commit is contained in:
parent
f8a563bdcd
commit
553f65a014
@ -22,3 +22,7 @@ test:
|
|||||||
.PHONY: test-verbose
|
.PHONY: test-verbose
|
||||||
test-verbose:
|
test-verbose:
|
||||||
perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' tests/*.t.pl
|
perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' tests/*.t.pl
|
||||||
|
|
||||||
|
.PHONY: benchmark
|
||||||
|
benchmark:
|
||||||
|
sudo tests/benchmark.pl /var/tmp
|
||||||
|
@ -11,8 +11,8 @@ require("tests/common.pl");
|
|||||||
|
|
||||||
# Download linux-3.0.tar.gz unless it already exists ("-c" flag)
|
# Download linux-3.0.tar.gz unless it already exists ("-c" flag)
|
||||||
sub dl {
|
sub dl {
|
||||||
our $linuxgz = "/tmp/linux-3.0.tar.gz";
|
our $linuxgz = "/var/tmp/linux-3.0.tar.gz";
|
||||||
print "# downloading linux-3.0.tar.gz... ";
|
print "# downloading linux-3.0.tar.gz (92MiB)... ";
|
||||||
system("wget -nv -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.0.tar.gz -O $linuxgz");
|
system("wget -nv -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.0.tar.gz -O $linuxgz");
|
||||||
print "done\n";
|
print "done\n";
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ sub benchmark {
|
|||||||
|
|
||||||
system("echo 3 > /proc/sys/vm/drop_caches");
|
system("echo 3 > /proc/sys/vm/drop_caches");
|
||||||
stopwatch_start("rsync");
|
stopwatch_start("rsync");
|
||||||
system("rsync -an $dir /tmp");
|
system("rsync -an $dir $dir/empty-rsync-target");
|
||||||
stopwatch_stop(\@results);
|
stopwatch_stop(\@results);
|
||||||
|
|
||||||
system("echo 3 > /proc/sys/vm/drop_caches");
|
system("echo 3 > /proc/sys/vm/drop_caches");
|
||||||
@ -188,7 +188,15 @@ sub tabulate {
|
|||||||
|
|
||||||
sub main {
|
sub main {
|
||||||
if ( $#ARGV < 0 ) {
|
if ( $#ARGV < 0 ) {
|
||||||
print "Usage: test/benchmark.pl MOUNTPOINT [MOUNTPOINT] [...]\n";
|
print "Usage: test/benchmark.pl DIR1 [DIR2] [...]\n";
|
||||||
|
print "\n";
|
||||||
|
print "Arguments:\n";
|
||||||
|
print " DIRn ... Working directory. This is where the encrypted files\n";
|
||||||
|
print " are stored. Specifying multiple directories will run\n";
|
||||||
|
print " the benchmark in each.\n";
|
||||||
|
print "\n";
|
||||||
|
print "For details about the testcases see PERFORMANCE.md.\n";
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user