On Wed, 5 Mar 2003, Todd C. Merrill wrote:
Has anyone written anything to parse the snapmirror logs to convert:
[...]
which adds elapsed time and transfer rate?
Thanks for the pointer! I further patched it to add the transfer rate I was looking for. Here's the diff file if anyone is interested (remove the ^M's from the original first and use `patch` to convert).
################################################################################ 667a668
my $duration = "";
669c670 < my $duration = get_duration_str($start_time, $time); ---
$duration = get_duration_str($start_time, $time);
673c674,685 < print " $event_data\n"; ---
if ($event_data =~ /Transfer Size: ((\d+) KB)/ ) { # calculate the rate my $size = $1; # in kB my ($time, $h, $m, $s); ($h,$m,$s) = split(/:/,$duration); $time = 60 * $h + $m + $s/60; # in minutes print " $event_data\t"; # to retain format: print the usual (above) and then append the rate printf("%s %9.3f %s", "Transfer rate:", ($size/1024)/$time, "MB/min\n"); } else { print " $event_data\n"; }
################################################################################
Output is now:
xxxxx:/vol/vol0/- => yyyyy:/vol/vol1/xxxxx_vol0 (Scheduled) transfer is completed. Start: Wed Mar 5 04:00:00 EST End: Wed Mar 5 04:42:36 EST Duration: 00:42:36 Transfer Size: (26374096 KB) Transfer rate: 604.600 MB/min
Wo-hoo!
Until next time...
The MathWorks, Inc. 508-647-7000 x7792 3 Apple Hill Drive, Natick, MA 01760-2098 508-647-7001 FAX tmerrill@mathworks.com http://www.mathworks.com ---