|
1 | | -# Release Notes for CpuGuard.NET |
2 | | -## Version 1.0.1 |
| 1 | +# Release Notes for CpuGuard.NET |
| 2 | + |
| 3 | +## Version 2.0.0 |
| 4 | + |
| 5 | +### Major Release - Comprehensive Resource Management |
| 6 | + |
| 7 | +This release transforms CpuGuard.NET into a full-featured resource management middleware with 10 new capabilities. |
| 8 | + |
| 9 | +#### New Features |
| 10 | + |
| 11 | +1. **Memory Limiting (MemoryGuard)** |
| 12 | + - Monitor and limit memory usage with percentage or absolute byte thresholds |
| 13 | + - Configurable response handling when limits are exceeded |
| 14 | + |
| 15 | +2. **Custom Response Handlers** |
| 16 | + - Define custom responses for throttled requests |
| 17 | + - Support for JSON, HTML, or any content type |
| 18 | + |
| 19 | +3. **Event Callbacks** |
| 20 | + - Subscribe to `OnCpuLimitExceeded` and `OnMemoryLimitExceeded` events |
| 21 | + - Integrate with logging, alerting, and monitoring systems |
| 22 | + |
| 23 | +4. **Health Check Integration** |
| 24 | + - ASP.NET Core health check support with `AddCpuGuardHealthChecks()` |
| 25 | + - Configurable degraded and unhealthy thresholds |
| 26 | + |
| 27 | +5. **OpenTelemetry Metrics** |
| 28 | + - Built-in metrics: `cpuguard_requests_throttled_total`, `cpuguard_cpu_usage_percent`, etc. |
| 29 | + - Export to Prometheus, Grafana, and other observability platforms |
| 30 | + |
| 31 | +6. **Gradual Throttling** |
| 32 | + - Progressive request delays as resource usage increases |
| 33 | + - Soft limit (start delaying) and hard limit (reject) thresholds |
| 34 | + - Linear or exponential delay modes |
| 35 | + |
| 36 | +7. **Path Exclusions** |
| 37 | + - Exclude specific paths from all guards (e.g., `/health`, `/metrics`) |
| 38 | + - Support for custom exclusion predicates |
| 39 | + |
| 40 | +8. **Rate Limiting** |
| 41 | + - Per-client rate limiting with Fixed Window, Sliding Window, or Token Bucket algorithms |
| 42 | + - CPU-aware rate limiting that reduces limits under high load |
| 43 | + - Standard `X-RateLimit-*` response headers |
| 44 | + |
| 45 | +9. **Real-time Dashboard** |
| 46 | + - Built-in HTML dashboard with live charts at `/cpuguard/dashboard` |
| 47 | + - JSON stats API at `/cpuguard/stats` and `/cpuguard/stats/full` |
| 48 | + - CPU/memory gauges, request statistics, and system info |
| 49 | + |
| 50 | +10. **Background Resource Monitoring** |
| 51 | + - Async CPU sampling via `ResourceMonitorService` |
| 52 | + - Accurate resource tracking without blocking requests |
| 53 | + |
| 54 | +#### Breaking Changes |
| 55 | + |
| 56 | +- Middleware now requires service registration via `AddCpuGuard()`, `AddMemoryGuard()`, etc. |
| 57 | +- Legacy API (`UseCpuLimitMiddleware`) still supported but deprecated |
| 58 | + |
| 59 | +#### New Dependencies |
| 60 | + |
| 61 | +- `Microsoft.Extensions.Hosting.Abstractions` (6.0.0) |
| 62 | +- `Microsoft.Extensions.Diagnostics.HealthChecks` (6.0.0) |
| 63 | +- `OpenTelemetry.Api` (1.7.0) |
| 64 | +- `System.Text.Json` (8.0.5) |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Version 1.0.1 |
3 | 69 | #### Whole Application CPU Limit: |
4 | 70 |
|
5 | 71 | 1. Introduced a middleware component to limit CPU usage across the entire ASP.NET Core application. |
|
0 commit comments