From 7b6c3f58b0f83130b30db58218cf9eed68755373 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Mon, 7 Nov 2016 10:55:30 +0000 Subject: [PATCH] Fix multiple month display of SAML 2 entities. Note that this won't go all the way back to the start of records because the XSLT depends on published metadata containing registrationAuthority metadata, which we started using in September 2012. --- charting/saml2.pl | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/charting/saml2.pl b/charting/saml2.pl index a0ccde17..bc69fd04 100755 --- a/charting/saml2.pl +++ b/charting/saml2.pl @@ -27,11 +27,21 @@ open(TXT, xalanCall . " -IN $fn -XSL saml2.xsl|") || die "could not open input file"; $_ = ; chop; + # print "$month: $_\n"; my ($entities, $idps, $sps, $saml2total, $saml2idp, $saml2sp) = split; - push @overallRatio, $saml2total/$entities; - push @idpRatio, $saml2idp/$idps; - push @spRatio, $saml2sp/$sps; - push @product, ($saml2idp/$idps)*($saml2sp/$sps); + if ($entities == 0) { + # print "skipping $month: $_\n"; + next; + } + my $mPrefix = $allMonths ? "$month: " : ''; + my $oRatio = $saml2total/$entities; + push @overallRatio, "$mPrefix$oRatio"; + my $iRatio = $saml2idp/$idps; + push @idpRatio, "$mPrefix$iRatio"; + my $sRatio = $saml2sp/$sps; + push @spRatio, "$mPrefix$sRatio"; + my $p = ($saml2idp/$idps)*($saml2sp/$sps); + push @product, "$mPrefix$p"; close TXT; } @@ -55,4 +65,4 @@ print "$ratio\n"; } -1; \ No newline at end of file +1;