Changeset 32626
- Timestamp:
- Nov 7, 2011, 2:06:14 PM (15 years ago)
- Location:
- tags/ipp-20110622/tools/diskspace
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
merge_counts_and_sizes.pl (modified) (4 diffs)
-
nebulous_data.pl (modified) (2 diffs)
-
nebulous_wiki.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20110622/tools/diskspace
- Property svn:mergeinfo changed
/trunk/tools/diskspace merged: 32622-32625
- Property svn:mergeinfo changed
-
tags/ipp-20110622/tools/diskspace/merge_counts_and_sizes.pl
r32603 r32626 29 29 chomp; 30 30 unless ($_ =~ /^#/) { 31 ($stage_product,$size_in_gb ) = split /\s+/;31 ($stage_product,$size_in_gb,$count) = split /\s+/; 32 32 ($stage,$product) = split /_/, $stage_product; 33 33 34 34 $size{$stage}{$product} = $size_in_gb; 35 $diskcount{$stage}{$product} = $count; 35 36 $total += $size_in_gb; 36 37 } 37 38 } 38 39 close(S); 40 41 $diskcount{"EXTERNAL"}{"UNKNOWN"} = 1; 39 42 40 43 my $count_file = "neb:///ipp_diskspace/${datestring}/run_im_counts.dat"; … … 92 95 if ($N{$stage}{$product} > 0) { 93 96 $VpN{$stage}{$state} += $map{$stage}{$product}{$state} * $size{$stage}{$product} / $N{$stage}{$product}; 97 $DVpN{$stage}{$state} += $map{$stage}{$product}{$state} * $size{$stage}{$product} / $diskcount{$stage}{$product}; 94 98 } 95 99 # print STDERR ">>$stage $product $state $map{$stage}{$product}{$state} $N{$stage}{$product} $count{$stage}{$state} $size{$stage}{$product} $VpN{$stage}{$state}\n"; … … 156 160 } 157 161 $labels{$label} += $V; 158 printf("%-8s %-18s %-10s %14.4f %12.6f %9d\n", 159 $stage,$state,$label,$V,$VpN{$stage}{$state},$count{$stage}{$state}); 162 $alt_labels{$label} += $DVpN{$stage}{$state} * $count{$stage}{$state}; 163 printf("%-8s %-18s %-10s\t%14.4f %12.6f\t%14.6f %12.6f\t%9d\n", 164 $stage,$state,$label,$V,$VpN{$stage}{$state},$DVpN{$stage}{$state} * $count{$stage}{$state},$DVpN{$stage}{$state},$count{$stage}{$state}); 160 165 if (exists($opt{N})) { 161 printf($out_fh "%-8s %-18s %-10s %14.4f %12.6f%9d\n",162 $stage,$state,$label,$V,$VpN{$stage}{$state},$ count{$stage}{$state});166 printf($out_fh "%-8s %-18s %-10s\t%14.4f %12.6f\t%14.6f %12.6f\t%9d\n", 167 $stage,$state,$label,$V,$VpN{$stage}{$state},$DVpN{$stage}{$state} * $count{$stage}{$state},$DVpN{$stage}{$state},$count{$stage}{$state}); 163 168 } 164 169 } … … 167 172 foreach $l (keys %labels) { 168 173 $sum += $labels{$l}; 169 print STDERR "\t$l \t$labels{$l}\n"; 174 $alt_sum += $alt_labels{$l}; 175 print STDERR "\t$l \t$labels{$l}\t$alt_labels{$l}\n"; 170 176 if (exists($opt{N})) { 171 print $out_fh "\t$l \t$labels{$l}\ n";177 print $out_fh "\t$l \t$labels{$l}\t$alt_labels{$l}\n"; 172 178 } 173 179 } 174 print STDERR "\tTOTAL \t$sum\ n";180 print STDERR "\tTOTAL \t$sum\t$alt_sum\n"; 175 181 print STDERR "\tEXP_TOT \t$total\n"; 176 182 177 183 if (exists($opt{N})) { 178 print $out_fh "\tTOTAL \t$sum\ n";184 print $out_fh "\tTOTAL \t$sum\t$alt_sum\n"; 179 185 print $out_fh "\tEXP_TOT \t$total\n"; 180 186 close($out_fh); -
tags/ipp-20110622/tools/diskspace/nebulous_data.pl
r32603 r32626 63 63 my $total_volume = 0; 64 64 my $used_volume = 0; 65 open(DF,"df -B 1 / data/${neb}/ |") || die "Cannot run df\n";65 open(DF,"df -B 1 /export/${neb}/ |") || die "Cannot run df\n"; 66 66 while(<DF>) { 67 67 chomp; … … 113 113 } 114 114 } 115 my $external_volume = $used_volume - $total_volume; 116 print $out_fh "EXTERNAL UNKNOWN 1 $external_volume\n"; 117 115 if ($used_volume > 0) { 116 my $external_volume = $used_volume - $total_volume; 117 print $out_fh "EXTERNAL UNKNOWN 1 $external_volume\n"; 118 } 118 119 close($out_fh); 119 120 -
tags/ipp-20110622/tools/diskspace/nebulous_wiki.pl
r32266 r32626 7 7 8 8 $opt{S} = 0; 9 getopts('S ',\%opt);9 getopts('SD:',\%opt); 10 10 11 my $dt = DateTime->now; 12 13 my @lt = gmtime; 14 my $dt_data = DateTime->now; 15 $dt->subtract( days => $lt[6]); 16 my $datestring = $dt->ymd; 11 my $datestring; 12 if (exists($opt{D})) { 13 $datestring = $opt{D}; 14 } 15 else { 16 my @lt = gmtime; 17 my $dt = DateTime->now; 18 $dt->subtract( days => $lt[6] ); 19 $datestring = $dt->ymd; 20 } 17 21 18 22 @files = sort ( split /\n/, `neb-ls -p neb:///ipp_diskspace/${datestring}/%neb_usage.dat`); … … 32 36 $sum{$volume} += $size; 33 37 $sizes{$what} += $size; 38 $counts{$what} += $count; 34 39 } 35 40 close(F); … … 65 70 print "\n"; 66 71 } 72 my $dt = DateTime->now; 67 73 $date = $dt->ymd; 68 74 print "${presep}${date}${sep}"; … … 88 94 foreach $w (sort (keys %sizes)) { 89 95 $val = $sizes{$w} / 1024 / 1024 / 1024; 90 print $out_fh "$w $val\n"; 96 $v2 = $counts{$w}; 97 print $out_fh "$w $val $v2\n"; 91 98 } 92 99 close($out_fh);
Note:
See TracChangeset
for help on using the changeset viewer.
