CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyrate-limiter

Python Rate-Limiter using Leaky-Bucket Algorithm for controlling request rates in applications with multiple backend storage options.

81

1.44x
Overview
Eval results
Files

rubric.jsonevals/scenario-1/

{
  "context": "This evaluation assesses how effectively the engineer uses PyrateLimiter's failing rate tracking capability to diagnose which specific rate limit is exceeded during rate limit violations.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Rate Definition",
      "description": "Uses Rate class to define multiple concurrent rate limits (per-second, per-minute, per-hour) with correct limit counts and Duration enum values",
      "max_score": 15
    },
    {
      "name": "Limiter Initialization",
      "description": "Creates a Limiter instance with appropriate configuration using the Rate objects and a suitable bucket (InMemoryBucket, SQLiteBucket, etc.)",
      "max_score": 15
    },
    {
      "name": "Non-blocking Acquisition",
      "description": "Uses try_acquire method with blocking=False parameter to check rate limits without waiting",
      "max_score": 20
    },
    {
      "name": "Failing Rate Access",
      "description": "Accesses the bucket's failing_rate property to identify which specific rate limit caused the rejection",
      "max_score": 30
    },
    {
      "name": "Rate Information Extraction",
      "description": "Extracts limit and interval information from the failing Rate object to construct meaningful diagnostic messages",
      "max_score": 15
    },
    {
      "name": "Return Value Structure",
      "description": "Returns a properly structured dictionary containing allowed status, user_id, and failing_limit description as specified",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/pypi-pyrate-limiter

tile.json