-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc.go
27 lines (27 loc) · 1021 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Package throttleproxy provides an adaptive backpressure proxy mechanism for dynamically managing
// traffic and protecting backend services using Prometheus metrics.
//
// Usage Example:
//
// config := proxymw.BackpressureConfig{
// EnableBackpressure: true,
// BackpressureQueries: []BackpressureQuery{
// {
// Query: `sum(rate(http_server_errors_total[5m]))`,
// Name: "http_error_rate"
// WarningThreshold: 0.5,
// EmergencyThreshold: 0.8,
// }
// },
// CongestionWindowMin: 10,
// CongestionWindowMax: 100,
// }
//
// Use Cases:
// - Protecting microservices from traffic spikes
// - Preventing cascading failures
// - Maintaining system stability under unpredictable load
//
// The package supports both server-side HTTP proxy and client-side RoundTripper
// implementations, providing flexible integration options.
package main // import "github.com/kevindweb/throttle-proxy"