mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-19 08:56:34 +00:00
Add rate_limit to JSON output.
This commit is contained in:
@@ -147,6 +147,25 @@ override query_report => sub {
|
||||
$global_data->{queries_per_second} = $qps if $qps;
|
||||
$global_data->{concurrency} = $conc if $conc;
|
||||
|
||||
if ( exists $results->{globals}->{rate_limit} ) {
|
||||
my $rate_limit = $results->{globals}->{rate_limit}->{min} || '';
|
||||
my ($type, $limit) = $rate_limit =~ m/^(\w+):(\d+)$/;
|
||||
if ( $type && $limit ) {
|
||||
$global_data->{rate_limit} = {
|
||||
type => $type,
|
||||
limit => int($limit),
|
||||
};
|
||||
}
|
||||
else {
|
||||
$global_data->{rate_limit}->{error} = "Invalid rate limit: $rate_limit";
|
||||
}
|
||||
|
||||
if ( ($results->{globals}->{rate_limit}->{min} || '')
|
||||
ne ($results->{globals}->{rate_limit}->{max} || '') ) {
|
||||
$global_data->{rate_limit}->{diff} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
my %hidden_attrib = (
|
||||
arg => 1,
|
||||
fingerprint => 1,
|
||||
|
Reference in New Issue
Block a user