Skip to content

Commit 1c44a60

Browse files
committed
Parameterize 001_pgbench.pl: allow to define a number of transactions, clients and threads from the environment.
1 parent 42f71b4 commit 1c44a60

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

t/001_pgbench.pl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,25 @@
1414
log_statement = 'ddl'
1515
});
1616

17-
# Test constants.
17+
# Test constants. Default values.
1818
my $TRANSACTIONS = 1000;
1919
my $CLIENTS = 10;
2020
my $THREADS = 10;
2121

22+
# Change pgbench parameters according to the environment variable.
23+
if (defined $ENV{TRANSACTIONS})
24+
{
25+
$TRANSACTIONS = $ENV{TRANSACTIONS};
26+
}
27+
if (defined $ENV{CLIENTS})
28+
{
29+
$CLIENTS = $ENV{CLIENTS};
30+
}
31+
if (defined $ENV{THREADS})
32+
{
33+
$THREADS = $ENV{THREADS};
34+
}
35+
2236
# General purpose variables.
2337
my $res;
2438
my $fss_count;

0 commit comments

Comments
 (0)