~percona-toolkit-dev/percona-toolkit/pt-mysql-summary-Blank-InnoDB-Section-for-5.6-1254233

« back to all changes in this revision

Viewing changes to bin/pt-heartbeat

  • Committer: Daniel Nichter
  • Date: 2013-06-19 21:23:55 UTC
  • mfrom: (582.1.5 release-2.2.3)
  • Revision ID: daniel@percona.com-20130619212355-nf6bmx23j3b76afe
Tags: 2.2.3
Merge release-2.2.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
# ###########################################################################
38
38
{
39
39
package Percona::Toolkit;
40
 
our $VERSION = '2.2.2';
 
40
 
 
41
our $VERSION = '2.2.3';
 
42
 
 
43
use strict;
 
44
use warnings FATAL => 'all';
 
45
use English qw(-no_match_vars);
 
46
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
 
47
 
 
48
use Carp qw(carp cluck);
 
49
use Data::Dumper qw();
 
50
 
 
51
require Exporter;
 
52
our @ISA         = qw(Exporter);
 
53
our @EXPORT_OK   = qw(
 
54
   have_required_args
 
55
   Dumper
 
56
   _d
 
57
);
 
58
 
 
59
sub have_required_args {
 
60
   my ($args, @required_args) = @_;
 
61
   my $have_required_args = 1;
 
62
   foreach my $arg ( @required_args ) {
 
63
      if ( !defined $args->{$arg} ) {
 
64
         $have_required_args = 0;
 
65
         carp "Argument $arg is not defined";
 
66
      }
 
67
   }
 
68
   cluck unless $have_required_args;  # print backtrace
 
69
   return $have_required_args;
 
70
}
 
71
 
 
72
sub Dumper {
 
73
   local $Data::Dumper::Indent    = 1;
 
74
   local $Data::Dumper::Sortkeys  = 1;
 
75
   local $Data::Dumper::Quotekeys = 0;
 
76
   Data::Dumper::Dumper(@_);
 
77
}
 
78
 
 
79
sub _d {
 
80
   my ($package, undef, $line) = caller 0;
 
81
   @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
 
82
        map { defined $_ ? $_ : 'undef' }
 
83
        @_;
 
84
   print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
 
85
}
41
86
 
42
87
1;
43
88
}
5959
6004
cause the tool to compute the lag incorrectly.  Specifying this option is
5960
6005
a good idea because it ensures that the tool works correctly regardless of
5961
6006
time zones, but it also makes the tool backwards-incompatible with
5962
 
pt-heartbeat 2.2.2 and older (unless the older version of pt-heartbeat
 
6007
pt-heartbeat 2.2.3 and older (unless the older version of pt-heartbeat
5963
6008
is running on a system that uses UTC).
5964
6009
 
5965
6010
=item --version
6141
6186
 
6142
6187
=head1 VERSION
6143
6188
 
6144
 
pt-heartbeat 2.2.2
 
6189
pt-heartbeat 2.2.3
6145
6190
 
6146
6191
=cut