# Stop when we have our number of samples
if (!exists $error_info{$q}{date} || ($#{$error_info{$q}{date}} < $sample)) {
- if ( ($q =~ /deadlock detected/) || ($real_error && !grep(/\Q$real_error\E/, @{$error_info{$q}{error}})) ) {
+ if ( ($q =~ /deadlock detected/) || ($real_error && !grep(/^\Q$real_error\E$/, @{$error_info{$q}{error}})) ) {
push(@{$error_info{$q}{date}}, $date);
push(@{$error_info{$q}{detail}}, $detail);
push(@{$error_info{$q}{context}}, $context);
foreach my $q (keys %_error_info) {
$error_info{$q}{count} += $_error_info{$q}{count};
- # Keep only the wanted sample number
- if (!exists $error_info{$q}{date} || ($#{$error_info{$q}{date}} < $sample)) {
- push(@{$error_info{$q}{date}}, @{$_error_info{$q}{date}});
- push(@{$error_info{$q}{detail}}, @{$_error_info{$q}{detail}});
- push(@{$error_info{$q}{context}}, @{$_error_info{$q}{context}});
- push(@{$error_info{$q}{statement}}, @{$_error_info{$q}{statement}});
- push(@{$error_info{$q}{hint}}, @{$_error_info{$q}{hint}});
- push(@{$error_info{$q}{error}}, @{$_error_info{$q}{error}});
- push(@{$error_info{$q}{db}}, @{$_error_info{$q}{db}});
- foreach my $day (keys %{ $_error_info{$q}{chronos} }) {
- foreach my $hour (keys %{$_error_info{$q}{chronos}{$day}}) {
- $error_info{$q}{chronos}{$day}{$hour}{count} += $_error_info{$q}{chronos}{$day}{$hour}{count};
- foreach my $min (keys %{$_error_info{$q}{chronos}{$day}{$hour}{min}}) {
- $error_info{$q}{chronos}{$day}{$hour}{min}{$min} += $_error_info{$q}{chronos}{$day}{$hour}{min}{$min};
- }
+ foreach my $day (keys %{ $_error_info{$q}{chronos} }) {
+ foreach my $hour (keys %{$_error_info{$q}{chronos}{$day}}) {
+ $error_info{$q}{chronos}{$day}{$hour}{count} += $_error_info{$q}{chronos}{$day}{$hour}{count};
+ foreach my $min (keys %{$_error_info{$q}{chronos}{$day}{$hour}{min}}) {
+ $error_info{$q}{chronos}{$day}{$hour}{min}{$min} += $_error_info{$q}{chronos}{$day}{$hour}{min}{$min};
}
}
}
+ for (my $i = 0; $i <= $#{$_error_info{$q}{date}}; $i++) {
+ &set_top_error_sample($q, $_error_info{$q}{date}[$i], $_error_info{$q}{error}[$i],
+ $_error_info{$q}{detail}[$i], $_error_info{$q}{context}[$i], $_error_info{$q}{statement}[$i],
+ $_error_info{$q}{hint}[$i], $_error_info{$q}{db}[$i]);
+ }
}
### per_minute_info ###