Develop serverless edge functions with PubNub Functions 2.0
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.79x
Baseline
Agent success rate without this tile
52%
{
"context": "Evaluates whether the agent correctly implements rate limiting within PubNub Functions while respecting the operation limit, using parallel execution for efficiency, time-windowed counters for rate tracking, and making an explicit choice about error handling behavior. Tests advanced Functions constraints.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Three operation budget",
"description": "The function uses no more than 3 combined KV/XHR/publish operations, or explicitly acknowledges this constraint in comments",
"max_score": 25
},
{
"name": "Time-windowed counter key",
"description": "Rate limit counter keys include a time window component derived from the current timestamp (e.g., Math.floor(Date.now() / windowMs)) so counters reset per window",
"max_score": 25
},
{
"name": "Atomic increment for rate check",
"description": "The rate check uses db.incrCounter() for an atomic increment-and-check, not a read-modify-write with db.get()/db.set()",
"max_score": 20
},
{
"name": "Explicit fail-open/closed",
"description": "The catch block makes an explicit choice: either request.ok() (fail open) or request.abort() (fail closed), with a comment explaining the reasoning",
"max_score": 15
},
{
"name": "Promise.all for parallel ops",
"description": "Independent operations are executed in parallel using Promise.all() rather than sequentially with individual awaits",
"max_score": 15
}
]
}