Skip to content

Commit 028ba64

Browse files
committed
Parameterize 001_pgbench.pl: allow to define a number of transactions, clients and threads from the environment.
1 parent 50d764e commit 028ba64

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy