Commit 0ba3905
Implement adaptive throttling phases 2-4 with quality monitoring
Phase 2: Transport-specific limits
- Add USB TMC, Serial, and TCP/IP specific queue depth and interval limits
- USB TMC: Conservative limits (5 queue depth, 1-2s intervals)
- Serial: Standard limits (10 queue depth, 0.5-1s intervals)
- TCP/IP: Higher buffering (15 queue depth, 0.5-1s intervals)
- Extract and pass transport_type through connection chain
Phase 3: Enhanced quality scoring
- Implement weighted recent history (2.0x for most recent 25%)
- Add quality trend detection using linear regression
- Quality tiers: excellent/good/fair/poor/critical
- Handle startup case with has_sufficient_data() check
- Override quality to critical for dead devices
Phase 4: Monitoring & metrics
- Extend DeviceMetrics with throttling metrics
- Add /metrics and /metrics/{device_id} API endpoints
- Record throttle events, backoff multiplier, quality scores
- Create comprehensive ADAPTIVE_THROTTLING.md documentation
Bug fixes:
- Fix empty dict reference bug in unified_scheduler (device_connections)
- Add missing time import in api.py
- Circuit breaker only blocks "dead" devices, not "unknown"
- Add recovery attempt logic (retry every 30s)
- Reduce circuit breaker log spam (200 skips vs 20)
- Fix frozen quality scores for dead devices
- Improve startup quality score handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6f25c74 commit 0ba3905
12 files changed
Lines changed: 1338 additions & 79 deletions
File tree
- benchmesh-serial-service
- src/benchmesh_service
- drivers
- owon_dge
- rigol_dho800
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
313 | 358 | | |
314 | 359 | | |
315 | 360 | | |
| |||
0 commit comments