Python Rate-Limiter using Leaky-Bucket Algorithm for controlling request rates in applications with multiple backend storage options.
81
Pending
Does it follow best practices?
Impact
81%
1.44xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
{
"context": "This criteria evaluates how well the engineer uses the pyrate-limiter package's basic limiter API to implement rate limiting functionality. The focus is on proper usage of the Rate class for defining rate limits, the Limiter class for managing rate limiting operations, and the try_acquire method for controlling request flow with both blocking and non-blocking modes.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Rate definition",
"description": "Uses the Rate class to define rate limits with proper limit count and time interval (e.g., Rate(5, Duration.MINUTE) or Rate(3, Duration.SECOND))",
"max_score": 20
},
{
"name": "Limiter initialization",
"description": "Creates Limiter instance properly, passing Rate objects and optionally a bucket backend (e.g., Limiter(rate) or Limiter(rate, bucket))",
"max_score": 20
},
{
"name": "try_acquire usage",
"description": "Uses the try_acquire method with appropriate parameters including identity/name and blocking parameter (e.g., limiter.try_acquire(client_id, blocking=True))",
"max_score": 25
},
{
"name": "Blocking mode",
"description": "Correctly implements blocking behavior by setting blocking=True in try_acquire, allowing the method to wait until a request can proceed",
"max_score": 15
},
{
"name": "Non-blocking mode",
"description": "Correctly implements non-blocking behavior by setting blocking=False in try_acquire, enabling immediate return of True/False without waiting",
"max_score": 15
},
{
"name": "Per-client routing",
"description": "Properly uses different identity/name values for different clients in try_acquire to maintain separate rate limit tracking for each client",
"max_score": 5
}
]
}docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10