Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrencyLimiter ¶
func ConcurrencyLimiter(cfg ConcurrencyConfig) echo.MiddlewareFunc
ConcurrencyLimiter returns an Echo middleware that limits concurrent handler executions. Excess requests are queued up to MaxQueueSize. Requests that cannot enter the queue receive 503 (SERVER_BUSY). Requests that wait longer than QueueTimeout receive 503 (SERVER_BUSY).
func MetricsHandler ¶ added in v0.5.0
func MetricsHandler(metrics *ConcurrencyMetrics, maxConcurrency, maxQueueSize int) echo.HandlerFunc
MetricsHandler returns an Echo handler that renders Prometheus text exposition format for the sandbox concurrency and queue gauges.
Types ¶
type ConcurrencyConfig ¶
type ConcurrencyConfig struct {
MaxConcurrency int
MaxQueueSize int
QueueTimeout time.Duration
Metrics *ConcurrencyMetrics
}
ConcurrencyConfig holds parameters for the concurrency limiter middleware.
Click to show internal directories.
Click to hide internal directories.