Created the zfs-replicate-wrapper script that factors in duration to
[zfs-nexenta/.git] / zfs-log-parser
index 4ecca3c37e59db5a4aaeecfa9dea6277b4dda928..94e4490b500a581b623dc6daa681eabb4e1735ff 100755 (executable)
@@ -52,14 +52,14 @@ sub parse_replicate_logfile {
        if(($in_replicate == 0) && ("$startdate" ne "") && ($line !~ /$startdate/)) { next; }
        if($line =~ /(\S+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\S+)\s+(\S+)/) {
            $dayname=$1; $month=$2; $daynum=$3; $hour=$4; $minute=$5; $sec=$6; $year=$8;
-           if(($in_replicate == 0) && ($line =~ /lock obtained/)) {
+           if(($in_replicate == 0) && ($line =~ /replicate started/)) {
                $in_replicate = 1;
                $date="$dayname $month $daynum $hour:$minute:$sec $year";
                $totals{$date}{data} = 0;
                $totals{$date}{transfertime} = 0;
                $totals{$date}{duration} = time_to_seconds($hour,$minute,$sec);
            }
-           elsif(($in_replicate == 1) && ($line=~ /lock released/)) {
+           elsif(($in_replicate == 1) && ($line=~ /replicate complete/)) {
                $in_replicate = 0;
                $totals{$date}{duration} = time_to_seconds($hour,$minute,$sec) - $totals{$date}{duration};
            }