CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-http-proxy-middleware

The one-liner node.js proxy middleware for connect, express, next.js and more

92

1.24x
Quality

Pending

Does it follow best practices?

Impact

92%

1.24x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-3/

{
  "context": "This criteria evaluates how well the engineer uses the http-proxy-middleware plugin system to implement a monitoring solution. The focus is on correct usage of the plugin interface, proper subscription to proxy lifecycle events, and effective manipulation of the http-proxy server instance.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Plugin function signature",
      "description": "Implements a plugin function with the correct signature that accepts (proxyServer, options) parameters",
      "max_score": 10
    },
    {
      "name": "proxyReq event subscription",
      "description": "Correctly subscribes to the 'proxyReq' event using proxyServer.on('proxyReq', handler) to track when requests are initiated",
      "max_score": 15
    },
    {
      "name": "proxyRes event subscription",
      "description": "Correctly subscribes to the 'proxyRes' event using proxyServer.on('proxyRes', handler) to track responses and calculate response times",
      "max_score": 15
    },
    {
      "name": "error event subscription",
      "description": "Correctly subscribes to the 'error' event using proxyServer.on('error', handler) to capture proxy errors",
      "max_score": 10
    },
    {
      "name": "Request tracking",
      "description": "Uses the proxyReq event handler to increment request counter and record start time (e.g., using Date.now() or similar)",
      "max_score": 10
    },
    {
      "name": "Response classification",
      "description": "Uses the proxyRes event handler to access proxyRes.statusCode and correctly categorize responses as success (< 400) or error (>= 400)",
      "max_score": 10
    },
    {
      "name": "Response time calculation",
      "description": "Calculates response time by comparing timestamps from proxyReq and proxyRes events, storing results in an array",
      "max_score": 10
    },
    {
      "name": "Error data capture",
      "description": "Uses the error event handler to capture error details including the error message, request URL (from req.url), and timestamp",
      "max_score": 10
    },
    {
      "name": "Metrics storage management",
      "description": "Implements array size limits by removing oldest entries when exceeding 1000 response times or 100 errors (e.g., using array.shift())",
      "max_score": 5
    },
    {
      "name": "Metrics accessor implementation",
      "description": "Provides a way to access metrics externally, either by returning a function from the plugin or attaching a method to the proxyServer instance",
      "max_score": 5
    }
  ]
}

tile.json