mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-04-25 12:04:48 +02:00
This is consistent with the way BackRest and BackRest test were renamed way back in 18fd2523. More modules will be moving to pgBackRestDoc soon so renaming now reduces churn later.
74 lines
3.0 KiB
Perl
74 lines
3.0 KiB
Perl
####################################################################################################################################
|
|
# Archive Performance Tests
|
|
####################################################################################################################################
|
|
package pgBackRestTest::Module::Performance::PerformanceArchivePerlTest;
|
|
use parent 'pgBackRestTest::Common::RunTest';
|
|
|
|
####################################################################################################################################
|
|
# Perl includes
|
|
####################################################################################################################################
|
|
use strict;
|
|
use warnings FATAL => qw(all);
|
|
use Carp qw(confess);
|
|
use English '-no_match_vars';
|
|
|
|
use Storable qw(dclone);
|
|
use Time::HiRes qw(gettimeofday);
|
|
|
|
use pgBackRestDoc::Common::Log;
|
|
|
|
use pgBackRestTest::Common::ExecuteTest;
|
|
use pgBackRestTest::Common::RunTest;
|
|
|
|
####################################################################################################################################
|
|
# initModule
|
|
####################################################################################################################################
|
|
sub initModule
|
|
{
|
|
my $self = shift;
|
|
|
|
$self->{strSpoolPath} = $self->testPath() . '/spool';
|
|
}
|
|
|
|
####################################################################################################################################
|
|
# initTest
|
|
####################################################################################################################################
|
|
sub initTest
|
|
{
|
|
my $self = shift;
|
|
|
|
# Create spool path
|
|
storageTest()->pathCreate($self->{strSpoolPath}, {bIgnoreExists => true, bCreateParent => true});
|
|
}
|
|
|
|
####################################################################################################################################
|
|
# run
|
|
####################################################################################################################################
|
|
sub run
|
|
{
|
|
my $self = shift;
|
|
|
|
################################################################################################################################
|
|
if ($self->begin("archive-push async (detect ok file)"))
|
|
{
|
|
#---------------------------------------------------------------------------------------------------------------------------
|
|
storageTest()->put(
|
|
storageTest()->openWrite(
|
|
'spool/archive/' . $self->stanza() . '/out/000000010000000100000001.ok', {bPathCreate => true}));
|
|
|
|
my $iRunTotal = 1;
|
|
my $lTimeBegin = gettimeofday();
|
|
|
|
for (my $iIndex = 0; $iIndex < $iRunTotal; $iIndex++)
|
|
{
|
|
executeTest(
|
|
$self->backrestExe() . ' --stanza=' . $self->stanza() . ' --archive-async --spool-path=' . $self->{strSpoolPath} .
|
|
' --archive-timeout=1 archive-push /pg_xlog/000000010000000100000001');
|
|
}
|
|
|
|
&log(INFO, 'time per execution: ' . ((gettimeofday() - $lTimeBegin) / $iRunTotal));
|
|
}
|
|
}
|
|
|
|
1;
|