Commit b3e82320 authored by Philip Carns's avatar Philip Carns

added remaining histograms, but it doesn't quite work yet


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@159 3b7491f3-a168-0410-bf4b-c445ed680a29
parent b1434ce8
......@@ -86,6 +86,20 @@ foreach my $file ( @csv_files )
add_summary(CSV);
add_histogram(CSV, $size_histo, "file size");
add_histogram(CSV, $cap_histo, "capacity used");
add_histogram(CSV, $pos_ovhd_histo, "positive overhead");
add_histogram(CSV, $neg_ovhd_histo, "negative overhead");
add_histogram(CSV, $dir_histo, "directory size (entries)");
add_histogram(CSV, $dirkb_histo, "directory size");
add_histogram(CSV, $fname_histo, "filename length");
add_histogram(CSV, $hlink_histo, "link count");
add_histogram(CSV, $slink_histo, "symlink target length");
add_histogram(CSV, $mtime_files_histo, "mtime (files)");
add_histogram(CSV, $mtime_bytes_histo, "mtime (KB)");
add_histogram(CSV, $ctime_files_histo, "ctime (files)");
add_histogram(CSV, $ctime_bytes_histo, "ctime (KB)");
add_histogram(CSV, $atime_files_histo, "atime (files)");
add_histogram(CSV, $atime_bytes_histo, "atime (KB)");
close(CSV);
}
......@@ -96,16 +110,37 @@ exit 0;
sub print_output
{
printf("#Generated by fsstats-merge.pl (fsstats v1.4.5)\n");
printf("#Comment: This is a comment line that can be modified or repeated before\n");
printf("#uploading to record voluntarily added information.\n\n");
printf("skipped special files,%d\n", $special_files);
printf("skipped duplicate hardlinks,%d\n", $skipped_hlink);
printf("skipped snapshot dirs,%d\n", $skipped_snapshot);
printf("total capacity used,%s\n", kb_to_print($total_cap_used));
printf("total user data,%s\n", kb_to_print($total_size));
printf("percent overhead,%f\n", ovhd_pct($total_size, $total_cap_used)/100);
open($fh, ">-") || die("Error opening output.\n");
printf($fh "#Generated by fsstats-merge.pl (fsstats v1.4.5)\n");
printf($fh "#Comment: This is a comment line that can be modified or repeated before\n");
printf($fh "#uploading to record voluntarily added information.\n\n");
printf($fh "skipped special files,%d\n", $special_files);
printf($fh "skipped duplicate hardlinks,%d\n", $skipped_hlink);
printf($fh "skipped snapshot dirs,%d\n", $skipped_snapshot);
printf($fh "total capacity used,%s\n", kb_to_print($total_cap_used));
printf($fh "total user data,%s\n", kb_to_print($total_size));
printf($fh "percent overhead,%f\n", ovhd_pct($total_size, $total_cap_used)/100);
printf($fh "\n");
$size_histo->print_csv($fh, "file size", "KB");
$cap_histo->print_csv($fh, "capacity used", "KB");
$pos_ovhd_histo->print_csv($fh, "positive overhead", "KB");
$neg_ovhd_histo->print_csv($fh, "negative overhead", "KB");
$dir_histo->print_csv($fh, "directory size (entries)", "ents");
$dirkb_histo->print_csv($fh, "directory size", "KB");
$fname_histo->print_csv($fh, "filename length", "chars");
$hlink_histo->print_csv($fh, "link count", "links");
$slink_histo->print_csv($fh, "symlink target length", "chars");
printf($fh "relative symlink target pct,%f\n" .
"absolute symlink target pct,%f\n",
$slink_relative ? $slink_relative / $slink_histo->{count} : 0,
$slink_absolute ? $slink_absolute / $slink_histo->{count} : 0);
$mtime_files_histo->print_csv($fh, "mtime (files)", "days");
$mtime_bytes_histo->print_csv($fh, "mtime (KB)", "days");
$ctime_files_histo->print_csv($fh, "ctime (files)", "days");
$ctime_bytes_histo->print_csv($fh, "ctime (KB)", "days");
$atime_files_histo->print_csv($fh, "atime (files)", "days");
$atime_bytes_histo->print_csv($fh, "atime (KB)", "days");
}
sub process_args
......@@ -236,7 +271,17 @@ sub add_histogram
}
}
# TODO: fix min/max
# fix min and max value
if(defined $old_min_val && $old_min_val < $min)
{$_[1]->{min_val} = $old_min_val;}
else
{$_[1]->{min_val} = $min;}
if(defined $old_max_val && $old_max_val < $max)
{$_[1]->{max_val} = $old_max_val;}
else
{$_[1]->{max_val} = $max;}
seek($file, 0, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment