Python Rate-Limiter using Leaky-Bucket Algorithm for controlling request rates in applications with multiple backend storage options.
81
{
"context": "This criteria evaluates how effectively the engineer uses PyrateLimiter's BucketFactory pattern to implement per-tenant rate limiting with dynamic bucket creation and tier-based routing. The focus is on proper use of the factory pattern, Rate configuration, and bucket management.",
"type": "weighted_checklist",
"checklist": [
{
"name": "BucketFactory usage",
"description": "Creates a custom class that inherits from or implements BucketFactory pattern, with a get() method that routes items to appropriate buckets based on tenant ID",
"max_score": 30
},
{
"name": "Rate configuration",
"description": "Uses Rate class to define tier-specific rate limits (10/minute for basic, 50/minute for premium, 200/minute for enterprise) with Duration.MINUTE",
"max_score": 20
},
{
"name": "Dynamic bucket creation",
"description": "Implements dynamic bucket creation in the factory's get() method or equivalent, creating InMemoryBucket instances on-demand for new tenants",
"max_score": 25
},
{
"name": "Limiter integration",
"description": "Uses Limiter class with the factory to perform rate limit enforcement via try_acquire() or similar method",
"max_score": 15
},
{
"name": "Per-tenant isolation",
"description": "Properly routes requests so each tenant gets an independent bucket, ensuring one tenant's usage doesn't affect another's limits",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-pyrate-limiterdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10