File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2136,6 +2136,37 @@ sub pg_recvlogical_upto
2136
2136
}
2137
2137
}
2138
2138
2139
+ sub pgbench ()
2140
+ {
2141
+ my ($self , $node , @args ) = @_ ;
2142
+ my $pgbench_handle = $self -> pgbench_async($node , @args );
2143
+ $self -> pgbench_await($pgbench_handle );
2144
+ }
2145
+
2146
+ sub pgbench_async ()
2147
+ {
2148
+ my ($self , @args ) = @_ ;
2149
+
2150
+ my ($in , $out , $err , $rc );
2151
+ $in = ' ' ;
2152
+ $out = ' ' ;
2153
+
2154
+ my @pgbench_command = (
2155
+ ' pgbench' ,
2156
+ -h => $self -> host,
2157
+ -p => $self -> port,
2158
+ @args
2159
+ );
2160
+ my $handle = IPC::Run::start(\@pgbench_command , $in , $out );
2161
+ return $handle ;
2162
+ }
2163
+
2164
+ sub pgbench_await ()
2165
+ {
2166
+ my ($self , $pgbench_handle ) = @_ ;
2167
+ IPC::Run::finish($pgbench_handle ) || BAIL_OUT(" pgbench exited with $? " );
2168
+ }
2169
+
2139
2170
=pod
2140
2171
2141
2172
=back
You can’t perform that action at this time.
0 commit comments