mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Update the code to work on current trunk.
Changes for 941469 conflicted with this fix, so this had to be updated.
This commit is contained in:
@@ -75,6 +75,7 @@ sub new {
|
||||
last_poll => 0,
|
||||
active_cxn => {}, # keyed off ID
|
||||
event_cache => [],
|
||||
_reasons_for_matching => {},
|
||||
};
|
||||
return bless $self, $class;
|
||||
}
|
||||
@@ -475,7 +476,15 @@ sub find {
|
||||
PTDEBUG && _d("Query isn't running long enough");
|
||||
next QUERY;
|
||||
}
|
||||
PTDEBUG && _d('Exceeds busy time');
|
||||
my $reason = 'Exceeds busy time';
|
||||
PTDEBUG && _d($reason);
|
||||
# Saving the reasons for each query in the objct is a bit nasty,
|
||||
# but the alternatives are worse:
|
||||
# - Saving internal data in the query
|
||||
# - Instead of using the stringified hashref as a key, using
|
||||
# a checksum of the hashes' contents. Which could occasionally
|
||||
# fail miserably due to timing-related issues.
|
||||
push @{$self->{_reasons_for_matching}->{$query} ||= []}, $reason;
|
||||
$matched++;
|
||||
}
|
||||
|
||||
@@ -486,7 +495,9 @@ sub find {
|
||||
PTDEBUG && _d("Query isn't idle long enough");
|
||||
next QUERY;
|
||||
}
|
||||
PTDEBUG && _d('Exceeds idle time');
|
||||
my $reason = 'Exceeds idle time';
|
||||
PTDEBUG && _d($reason);
|
||||
push @{$self->{_reasons_for_matching}->{$query} ||= []}, $reason;
|
||||
$matched++;
|
||||
}
|
||||
|
||||
@@ -507,7 +518,9 @@ sub find {
|
||||
PTDEBUG && _d('Query does not match', $property, 'spec');
|
||||
next QUERY;
|
||||
}
|
||||
PTDEBUG && _d('Query matches', $property, 'spec');
|
||||
my $reason = 'Query matches ' . $property . ' spec';
|
||||
PTDEBUG && _d($reason);
|
||||
push @{$self->{_reasons_for_matching}->{$query} ||= []}, $reason;
|
||||
$matched++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user