From 46107218b615583899a256093b0b337ba6478299 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Thu, 19 Nov 2009 14:40:28 +0000 Subject: [PATCH] Start separate area for charting tools. This is intended for tools that are not part of the normal metadata build process, which for now at least will remain in the build directory. --- charting/fetch.pl | 25 +++++++++++++++++++++++++ charting/sizes.pl | 29 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100755 charting/fetch.pl create mode 100755 charting/sizes.pl diff --git a/charting/fetch.pl b/charting/fetch.pl new file mode 100755 index 00000000..53874d3a --- /dev/null +++ b/charting/fetch.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w + +# +# fetch.pl +# +use File::stat; + +$fn = '../xml/ukfederation-metadata.xml'; + +@months = ( + '2006-12', + '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', + '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', + '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', + '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', + '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', + '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', +); + +foreach $month (@months) { + print "Fetching $month..."; + system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}"); + system("cp $fn cache/$month.xml"); + print "\n"; +} diff --git a/charting/sizes.pl b/charting/sizes.pl new file mode 100755 index 00000000..b6e1d4a0 --- /dev/null +++ b/charting/sizes.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +# +# sizes.pl +# +use File::stat; + +$fn = '../xml/ukfederation-metadata.xml'; + +@months = ( + '2006-12', + '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', + '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', + '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', + '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', + '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', + '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', +); + +print "month size entities ratio\n"; + +foreach $month (@months) { + system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}"); + $stat = stat('../xml/ukfederation-metadata.xml'); + $size = $stat->size; + $wc = int(`grep '