mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-21 02:00:45 +08:00
PR-471 - Support adding explain output for slow query in JSON report as well
- Put fix into the proper place - Added test cases
This commit is contained in:
@@ -241,6 +241,7 @@ override query_report => sub {
|
||||
: undef;
|
||||
my $fingerprint = substr($item, 0, $self->max_fingerprint_length);
|
||||
my $checksum = make_checksum($item);
|
||||
my $explain = $self->explain_report($sample->{arg}, $sample->{db});
|
||||
my $class = {
|
||||
checksum => $checksum,
|
||||
fingerprint => $fingerprint,
|
||||
@@ -252,6 +253,8 @@ override query_report => sub {
|
||||
query => substr($sample->{arg}, 0, $self->max_query_length),
|
||||
ts => $sample->{ts} ? parse_timestamp($sample->{ts}) : undef,
|
||||
Query_time => $sample->{Query_time},
|
||||
$explain ?
|
||||
( explain => $explain ): (),
|
||||
},
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user