From e0022fedb09f3e9d36ebdc78c06aa6a73c9926c1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 1 Jan 2023 10:48:07 +0000 Subject: [PATCH] Report on gdns allocations --- bin/mkgeo | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/mkgeo b/bin/mkgeo index f5ecbd3..4a183e8 100755 --- a/bin/mkgeo +++ b/bin/mkgeo @@ -221,6 +221,17 @@ while (grep { !exists($_->{cluster}) } values %$origins) allocate_clusters(@mappings); } +# Report on allocation results +foreach my $name (sort keys %$clusters) +{ + my $cluster = $clusters->{$name}; + my $used = int($cluster->{requests_used} + 0.5); + my $limit = $cluster->{requests_limit}; + my $proportion = int($used / $limit * 100 + 0.5); + + print "${name}: used ${used} of ${limit} (${proportion}%)\n"; +} + # Create JSON collection object my @json; -- 2.39.5