@stephen-shopopop/node-metrics
    Preparing search index...
    • Creates a Hono middleware that monitors system metrics and returns a 503 Service Unavailable response when the system is under pressure, as determined by the provided options and current metrics.

      Parameters

      Returns MiddlewareHandler

      A Hono MiddlewareHandler that checks system pressure and responds accordingly.

      app.use('*', underPressureHonoMiddleware({
      sampleIntervalInMs: 1000,
      resolution: 10,
      webServerMetricsPort: 9090,
      maxEventLoopDelay: 1000,
      maxEventLoopUtilization: 0.9
      }));