Changeset 8074 for lang/perl/App-MadEye

Show
Ignore:
Timestamp:
03/18/08 15:46:49 (9 months ago)
Author:
tokuhirom
Message:

threshold を変更可能にしてみる。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/App-MadEye/trunk/lib/App/MadEye/Plugin/Agent/MySQLSlave.pm

    r8073 r8074  
    1313    my $user     = $self->config->{config}->{user} or die "missing user"; 
    1414    my $password = $self->config->{config}->{password}; 
     15    my $threshold = $self->config->{config}->{threshold}; 
    1516 
    1617    my $dbh = DBI->connect( 
     
    4041        my $rmlp = $row->{'Read_Master_Log_Pos'}; 
    4142        my $emlp = $row->{'Exec_Master_Log_Pos'}; 
    42         if ( $rmlp > $emlp + 10**5 ) { # XXX configurable. 
     43        if ( abs($rmlp - $emlp) > $threshold ) { 
    4344            return "considerable delay : $rmlp $emlp\n"; 
    4445        } 
     
    7273            required: yes 
    7374            type: any 
     75        threshold: 
     76            required: yes 
     77            type: int 
    7478 
    7579=head1 AUTHORS