while ($page <= $pages)
{
- my $response = $ua->get("https://api.statuscake.com/v1/uptime?limit=100&page=${page}");
+ my $response = $ua->get("https://api.statuscake.com/v1/uptime?nouptime=true&limit=100&page=${page}");
if ($response->is_success)
{
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};
+
+ if ($limit > 0)
+ {
+ my $proportion = int($used / $limit * 100 + 0.5);
+
+ print "${name}: used ${used} of ${limit} (${proportion}%)\n";
+ }
+ else
+ {
+ print "${name}: used ${used} of ${limit}\n";
+ }
+}
+
# Create JSON collection object
my @json;