Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zonemaster/zonemaster-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a3a46df4baf4be1a41a0916d983e220170237b74
Choose a base ref
..
head repository: zonemaster/zonemaster-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fd5075ce3b5a6bae4aa20da9454c321e44f03135
Choose a head ref
Showing with 14 additions and 10 deletions.
  1. +14 −10 lib/Zonemaster/CLI.pm
24 changes: 14 additions & 10 deletions lib/Zonemaster/CLI.pm
Original file line number Diff line number Diff line change
@@ -727,9 +727,10 @@ sub run {

my $total_queries_count = 0;
my $total_queries_times = 0;
my %nss_already_processed;

sub print_nstimes {
my ( $ns, $max, $total_queries_count, $total_queries_times ) = @_;
my ( $ns, $max, $total_queries_count, $total_queries_times, %nss_already_processed ) = @_;

printf "%${max}s ", $ns->string;
printf "%9.2f ", 1000 * $ns->max_time;
@@ -739,28 +740,31 @@ sub run {
printf "%8.2f ", 1000 * $ns->median_time;
printf "%9.2f ", 1000 * $ns->sum_time;
printf "%9d\n", scalar @{ $ns->times };
$total_queries_count += scalar @{ $ns->times };
$total_queries_times += ( 1000 * $ns->sum_time );
$total_queries_count += scalar @{ $ns->times } unless $nss_already_processed{$ns};
$total_queries_times += ( 1000 * $ns->sum_time ) unless $nss_already_processed{$ns};

return $total_queries_count, $total_queries_times;
return $total_queries_count, $total_queries_times, %nss_already_processed;
}

printf __("%s %s\n"), 'Child', '-' x ( ( $max - length 'Child' ) - 1 );
foreach my $ns ( sort @zone_nss ) {
( $total_queries_count, $total_queries_times ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times );
( $total_queries_count, $total_queries_times, %nss_already_processed ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times, %nss_already_processed );
$nss_already_processed{$ns} = 1;
}

printf __("%s %s\n"), 'Parent', '-' x ( ( $max - length 'Parent' ) - 1 );
foreach my $ns ( sort @parent_nss ) {
( $total_queries_count, $total_queries_times ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times );
( $total_queries_count, $total_queries_times, %nss_already_processed ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times, %nss_already_processed );
$nss_already_processed{$ns} = 1;
}

printf __("%s %s\n"), 'Other', '-' x ( ( $max - length 'Other' ) - 1 );
foreach my $ns ( sort @filtered_nss ) {
( $total_queries_count, $total_queries_times ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times );
( $total_queries_count, $total_queries_times, %nss_already_processed ) =
print_nstimes( $ns, $max, $total_queries_count, $total_queries_times, %nss_already_processed );
$nss_already_processed{$ns} = 1;
}

printf "%${max}s %s\n", '=' x $max, ' ======== ======== ======== ======== ======== ========= =========';