1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Revive archive performance test.

This test was lost due to a syntax issue in a58635ac.

Update the test to use system() to better mimic what postgres does and add logging so pgBackRest timing can be determined.
This commit is contained in:
David Steele
2021-11-10 12:14:41 -05:00
parent dd96c29f96
commit 43cfa9cef7
2 changed files with 12 additions and 4 deletions

View File

@ -28,6 +28,7 @@ sub initModule
my $self = shift;
$self->{strSpoolPath} = $self->testPath() . '/spool';
$self->{strLogPath} = $self->testPath() . '/log';
}
####################################################################################################################################
@ -39,6 +40,7 @@ sub initTest
# Create spool path
storageTest()->pathCreate($self->{strSpoolPath}, {bIgnoreExists => true, bCreateParent => true});
storageTest()->pathCreate($self->{strLogPath}, {bIgnoreExists => true, bCreateParent => true});
}
####################################################################################################################################
@ -56,14 +58,20 @@ sub run
storageTest()->openWrite(
'spool/archive/' . $self->stanza() . '/out/000000010000000100000001.ok', {bPathCreate => true}));
my $iRunTotal = 1;
my $iRunTotal = 100;
my $lTimeBegin = gettimeofday();
for (my $iIndex = 0; $iIndex < $iRunTotal; $iIndex++)
{
executeTest(
my $iResult = system(
$self->backrestExe() . ' --stanza=' . $self->stanza() . ' --archive-async --spool-path=' . $self->{strSpoolPath} .
' --archive-timeout=1 archive-push /pg_xlog/000000010000000100000001');
' --log-level-file=detail --log-path=' . $self->{strLogPath} . ' --archive-timeout=1' .
' --pg1-path=/not/used archive-push /pg_xlog/000000010000000100000001');
if ($iResult != 0)
{
confess "archive-push returned ${iResult}";
}
}
&log(INFO, 'time per execution: ' . ((gettimeofday() - $lTimeBegin) / $iRunTotal));