Test --run-time and --progress.

This commit is contained in:
Daniel Nichter
2013-03-11 17:12:43 -06:00
parent 3c07da8499
commit d66be7558a
5 changed files with 168 additions and 2 deletions

View File

@@ -82,6 +82,13 @@ has 'read_timeout' => (
default => 0,
);
has 'progress' => (
is => 'ro',
isa => 'Maybe[Object]',
required => 0,
default => sub { return },
);
##
# Private
##
@@ -197,6 +204,10 @@ sub next {
) {
$self->stats->{queries_read}++;
if ( my $pr = $self->progress ) {
$pr->update($self->_parser_args->{tell});
}
if ( ($event->{cmd} || '') ne 'Query' ) {
PTDEBUG && _d('Skipping non-Query cmd');
$self->stats->{not_query}++;