tessl install tessl/pypi-pyrate-limiter@3.9.0Python Rate-Limiter using Leaky-Bucket Algorithm for controlling request rates in applications with multiple backend storage options.
Agent Success
Agent success rate when using this tile
81%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.45x
Baseline
Agent success rate without this tile
56%
{
"context": "This criteria evaluates how well the engineer uses the pyrate-limiter package's RedisBucket functionality to implement a distributed rate limiting system. The focus is on proper usage of RedisBucket initialization, rate configuration with Rate and Duration classes, Limiter integration, and both synchronous and asynchronous rate limit checks.",
"type": "weighted_checklist",
"checklist": [
{
"name": "RedisBucket initialization",
"description": "Uses RedisBucket.init() class method to create bucket instance with Redis client connection and appropriate bucket_key parameter",
"max_score": 25
},
{
"name": "Rate configuration",
"description": "Correctly defines rate limits using Rate class with limit of 100 and Duration.MINUTE for the time interval",
"max_score": 15
},
{
"name": "Limiter integration",
"description": "Creates and uses Limiter instance initialized with the RedisBucket to perform rate limit checks",
"max_score": 15
},
{
"name": "Synchronous rate checking",
"description": "Uses limiter.try_acquire() method with user_id as the name parameter to check rate limits synchronously",
"max_score": 15
},
{
"name": "Asynchronous rate checking",
"description": "Uses limiter.try_acquire_async() method with user_id as the name parameter to check rate limits asynchronously with await",
"max_score": 15
},
{
"name": "Wait time calculation",
"description": "Uses bucket.waiting() method to calculate wait time in milliseconds when rate limit is exceeded",
"max_score": 10
},
{
"name": "State management",
"description": "Uses bucket.flush() or bucket operations to reset user limits and bucket.count() to retrieve current request counts",
"max_score": 5
}
]
}