Skip to content

Commit

Permalink
Work from cache, split out sizes and ratios into separate blocks to a…
Browse files Browse the repository at this point in the history
…llow import into Keynote.
  • Loading branch information
iay committed Nov 19, 2009
1 parent 4610721 commit 50584c5
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions charting/sizes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#
use File::stat;

$fn = '../xml/ukfederation-metadata.xml';

@months = (
'2006-12',
'2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06',
Expand All @@ -17,13 +15,46 @@
'2009-07', '2009-08', '2009-09', '2009-10', '2009-11',
);

print "month size entities ratio\n";

# ingest files
foreach $month (@months) {
system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}");
$stat = stat('../xml/ukfederation-metadata.xml');
my $fn = "cache/$month.xml";
$stat = stat($fn);
$size = $stat->size;
$wc = int(`grep '</Entity' $fn | wc -l`);
$ratio = int($size/$wc);
print "$month $size $wc $ratio\n";
push @sizes, $size;
push @counts, $wc;
push @ratios, $ratio;
}

print "months\n";
foreach $month (@months) {
print "$month\n";
}

print "size\n";
foreach $size (@sizes) {
print "$size\n";
}

print "sizeM\n";
foreach $size (@sizes) {
$size /= 1000000;
print "$size\n";
}

print "entities\n";
foreach $count (@counts) {
print "$count\n";
}

print "ratio\n";
foreach $ratio (@ratios) {
print "$ratio\n";
}

print "ratioK\n";
foreach $ratio (@ratios) {
$ratio /= 1000;
print "$ratio\n";
}

0 comments on commit 50584c5

Please sign in to comment.