evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates how well the engineer uses the node-postgres (pg) package's connection pooling features, specifically focusing on the maxUses configuration parameter for automatic connection recycling. The evaluation assesses proper use of Pool class, pool configuration options, and connection lifecycle management.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Pool instantiation",
"description": "Creates a Pool instance using the Pool constructor from the pg package (e.g., new Pool(config) or require('pg').Pool)",
"max_score": 15
},
{
"name": "maxUses configuration",
"description": "Configures the pool with the maxUses parameter set to limit connection reuse (e.g., maxUses: 10 in the pool configuration object)",
"max_score": 25
},
{
"name": "max parameter",
"description": "Sets the max parameter to configure the maximum number of connections in the pool (e.g., max: 5)",
"max_score": 10
},
{
"name": "idleTimeoutMillis configuration",
"description": "Configures idleTimeoutMillis parameter for idle connection timeout (e.g., idleTimeoutMillis: 5000)",
"max_score": 10
},
{
"name": "Pool.query method",
"description": "Uses pool.query() method for executing queries with automatic connection checkout and release",
"max_score": 20
},
{
"name": "Pool.end method",
"description": "Uses pool.end() method to gracefully shut down the pool and close all connections",
"max_score": 15
},
{
"name": "Async/await or promises",
"description": "Properly handles asynchronous operations using async/await or promises for pool.query() and pool.end() methods",
"max_score": 5
}
]
}