Branch Coverage

blib/lib/PAGI/Middleware/RateLimit.pm
Criterion Covered Total %
branch 17 20 85.0


line true false branch
79 38 0 exists $scope->{'client'} ? :
91 0 41 if ($scope->{'type'} ne "http")
99 4 37 unless ($allowed)
107 37 37 if ($event->{'type'} eq 'http.response.start') { }
142 1 40 if $bucket->{'tokens'} > $burst
147 37 4 if ($bucket->{'tokens'} >= 1) { }
159 10 31 if (not $self->{'_last_cleanup'} or $now - $self->{'_last_cleanup'} >= $self->{'cleanup_interval'})
163 6 10 if $buckets{$k}{'last_time'} < $stale_threshold
168 1 40 if (keys %buckets > $self->{'max_buckets'})
181 0 4 if $retry_after < 1