Use host instead of Host.

This commit is contained in:
Daniel Nichter
2012-07-17 09:53:07 -06:00
parent b2fb12853f
commit 28f50bbac5
3 changed files with 15 additions and 8 deletions

View File

@@ -3048,7 +3048,7 @@ sub _calc_metrics {
sub metrics {
my ( $self, %args ) = @_;
foreach my $arg ( qw(attrib where) ) {
die "I need a $arg argument" unless $args{$arg};
die "I need a $arg argument" unless defined $args{$arg};
}
my $attrib = $args{attrib};
my $where = $args{where};
@@ -8628,13 +8628,13 @@ package UpgradeReportFormatter;
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use constant PTDEBUG => $ENV{PTDEBUG};
Transformers->import(qw(make_checksum percentage_of shorten micro_t));
use constant LINE_LENGTH => 74;
use constant MAX_STRING_LENGTH => 10;
Transformers->import(qw(make_checksum percentage_of shorten micro_t));
my %formatting_function = (
ts => sub {
my ( $stats ) = @_;
@@ -8671,6 +8671,12 @@ sub event_report {
$line .= ('_' x (LINE_LENGTH - length($line)));
push @result, $line;
my $hostno = 0;
foreach my $host ( @$hosts ) {
$hostno++;
push @result, "# Host$hostno: " . ($host->{name} || '?')
}
my $class = $meta_stats->{classes}->{$where};
push @result,
'# Found ' . ($class->{differences}->{sum} || 0)
@@ -8687,9 +8693,10 @@ sub event_report {
underline_header => 0,
strip_whitespace => 0,
);
$hostno = 0;
$report->set_columns(
{ name => '' },
map { { name => $_->{name}, right_justify => 1 } } @$hosts,
map { $hostno++; { name => "host$hostno", right_justify => 1 } } @$hosts,
);
foreach my $thing ( qw(Errors Warnings) ) {
my @vals = $thing;

View File

@@ -75,7 +75,7 @@ sub event_report {
my $hostno = 0;
foreach my $host ( @$hosts ) {
$hostno++;
push @result, "# Host$hostno: " . ($host->{name} || '?')
push @result, "# host$hostno: " . ($host->{name} || '?')
}
# Differences report. This relies on a sampleno attrib in each class

View File

@@ -110,8 +110,8 @@ $meta_events = [
$expected = <<EOF;
# Query 1: ID 0x82860EDA9A88FCC5 at byte 0 _______________________________
# Host1: host1.domain.com:3306
# Host2: host2.domain.com:3307
# host1: host1.domain.com:3306
# host2: host2.domain.com:3307
# Found 1 differences in 3 samples:
# checksums 0
# row counts 1