-# Copyright (c) 2010 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2010-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
my ($host, $disk) = @$dle;
my $dle_info = $self->{'report'}->get_dle_info($host, $disk);
- # run once for each try for this DLE
- foreach my $try (@{$dle_info->{'tries'}}) {
-
- next unless exists $try->{taper};
- my $taper = $try->{taper};
-
- my $parts = $taper->{parts};
- next unless @$parts > 0;
-
- my $first_part = $parts->[0];
- next unless $first_part->{label} eq $label;
-
- my $filenum = $first_part->{file};
-
- # sum the part sizes on this label to get the outsize. Note that
- # the postscript output does not contain a row for each part, but
- # for each part..
- my $outsize = 0;
- for my $part (@$parts) {
- next unless $part->{'label'} eq $label;
- $outsize += $part->{'kb'};
- }
-
- # Get origsize for this try.
- my $origsize = 0;
- my $level = -1;
-
- # TODO: this is complex and should probably be in a parent-class method
- if (exists $try->{dumper} and ($try->{dumper}{status} ne 'fail')) {
- my $try_dumper = $try->{dumper};
- $level = $try_dumper->{level};
- $origsize = $try_dumper->{orig_kb};
- } else { # we already know a taper run exists in this try
- $level = $taper->{level};
- $origsize = $taper->{orig_kb} if $taper->{orig_kb};
- }
-
- $total_outsize += $outsize;
- $total_origsize += $origsize;
-
- if ($outsize != $origsize) {
- $comp_outsize += $outsize;
- $comp_origsize += $origsize;
+ my $alldumps = $dle_info->{'dumps'};
+
+ while( my ($timestamp, $tries) = each %$alldumps ) {
+ # run once for each try for this DLE
+ foreach my $try (@$tries) {
+
+ next unless exists $try->{taper};
+ my $taper = $try->{taper};
+
+ my $parts = $taper->{parts};
+ next unless @$parts > 0;
+
+ my $first_part = $parts->[0];
+ my $dlename = undef;
+ if ($first_part->{label} eq $label) {
+ $dlename = $disk;
+ } else { #find if one part is on the volume
+ foreach $parts (@$parts) {
+ if ($parts->{label} eq $label) {
+ $dlename = '- ' . $disk;
+ last;
+ }
+ }
+ next if !defined $dlename;
+ }
+
+ my $filenum = $first_part->{file};
+
+ # sum the part sizes on this label to get the outsize. Note that
+ # the postscript output does not contain a row for each part, but
+ # for each part..
+ my $outsize = 0;
+ for my $part (@$parts) {
+ next unless $part->{'label'} eq $label;
+ $outsize += $part->{'kb'};
+ }
+
+ # Get origsize for this try.
+ my $origsize = 0;
+ my $level = -1;
+
+ # TODO: this is complex and should probably be in a parent-class method
+ if (exists $try->{dumper} and ($try->{dumper}{status} ne 'fail')) {
+ my $try_dumper = $try->{dumper};
+ $level = $try_dumper->{level};
+ $origsize = $try_dumper->{orig_kb};
+ } else { # we already know a taper run exists in this try
+ $level = $taper->{level};
+ $origsize = $taper->{orig_kb} if $taper->{orig_kb};
+ }
+
+ $total_outsize += $outsize;
+ $total_origsize += $origsize;
+
+ if ($outsize != $origsize) {
+ $comp_outsize += $outsize;
+ $comp_origsize += $origsize;
+ }
+
+ push @first_parts, [$host, $dlename, $level, $filenum, $origsize, $outsize];
}
-
- push @first_parts, [$host, $disk, $level, $filenum, $origsize, $outsize];
}
}
# count filemarks in the tapeused assessment