-
Notifications
You must be signed in to change notification settings - Fork 466
/
Copy pathrunperfbench.pl
executable file
·92 lines (76 loc) · 2.58 KB
/
runperfbench.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/perl
# Usage:
# runperfbench <revision>
#
# Expects to run from newtrunk/
# Builds the revision specified on the command line.
# Copies obj/release/voltbin/* to volt3a:~/voltbin
# Runs the benchmark.
# appends result to perfout.txt in the cwd.
# moves to the previous revision on this branch
# Wash. Rinse. Repeat.
my $base_revision = $ARGV[0];
my $hostcount = 5;
my $sitesperhost = 12;
my $warehouses = $hostcount * $sitesperhost;
# my $benchcmd = "ant -Dbuild=release -Dhostcount=$hostcount -Dsitesperhost=$sitesperhost -Dwarehouses=$warehouses benchmarkcluster";
my $benchcmd = "ant benchmark -Dclientcount=3 -Dhostcount=5 -Dhost1=volt3a -Dhost2=volt3b -Dhost3=volt3c -Dhost4=volt3d -Dhost5=volt3e -Dhost6=volt3f -Dprocessesperclient=1 -Dwarehouses=60 -Dclienthost1=volt4a -Dclienthost2=volt4b -Dclienthost3=volt4c -Dsitesperhost=12 -Dduration=180000 -Dloadthreads=8";
open(PERFOUT, ">>perfout.txt") or die ("Can't open perfout.txt");
print PERFOUT "# $benchcmd\n";
printf "Updating svn to revision $base_revision\n";
`svn update -r $base_revision`;
sub getNextRevision() {
my $revision = 0; # make this invalid and discover next revision.
@update_stdout = `svn update -r PREV`;
foreach $line (@update_stdout) {
if ($line =~ m/Updated to revision (\d+)/) {
$revision = $1;
break;
}
}
return $revision;
}
for ($revision = $base_revision; $revision > 0; ) {
printf "Running at svn revision %s\n", $revision;
printf "Building and copying voltbin to volt3a.\n";
`rm -rf obj/release`;
$exitcode = `ant -Dbuild=release`;
if ($exitcode != 0) {
print PERFOUT "# $revision 'ant -Dbuild=release' failure\n";
$revision = getNextRevision();
next;
}
$exitcode = `ant -Dbuild=release voltbin`;
if ($exitcode != 0) {
print PERFOUT "# $revision 'ant -Dbuild=release voltbin' failure\n";
$revision = getNextRevision();
next;
}
$exitcode = `scp obj/release/voltbin/* volt3a:~/voltbin`;
if ($exitcode != 0) {
print PERFOUT "# $revision scp to volt3a failed\n";
$revision = getNextRevision();
next;
}
for ($run=0; $run < 3; $run++) {
printf "TPC-C benchmark revision $revision run $run\n";
@tpcc_stdout = `$benchcmd`;
$printing = 0;
foreach $line (@tpcc_stdout) {
if ($line =~ m/.*?BENCHMARK\sRESULTS.*?/) {
$printing = 1;
}
elsif ($line =~ m/.*?===========.*?/) {
$printing = 0;
}
if ($printing == 1) {
print $line;
}
if ($line =~ m/.*?Transactions per second:\s(\d+)/) {
$tps = $1;
print PERFOUT "$revision\t$tps\n";
}
}
}
$revision = getNextRevision();
}