Skip to content

resource_monitors: add WorkerUtilizationTracker for event-loop utilization - #49399

Draft
antoniovleonti wants to merge 3 commits into
envoyproxy:mainfrom
antoniovleonti:awc-worker-utilization-tracker
Draft

antoniovleonti wants to merge 3 commits into
envoyproxy:mainfrom
antoniovleonti:awc-worker-utilization-tracker

Conversation

@antoniovleonti

@antoniovleonti antoniovleonti commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Commit Message: resource_monitors: add WorkerUtilizationTracker for event-loop utilization

Introduces WorkerUtilizationTrackerInterface and WorkerUtilizationTracker, a single-threaded Event::Evwatch::Observer that measures a worker thread's event-loop utilization ([0.0, 1.0]):

  • Records completed epoll_wait idle durations (onPrepare to onCheck), capping intentional sleep at *timeout when a finite poll timeout was requested so late-wakeup scheduler delays count as busy time.
  • Because sampleUtilization() always executes inside a callback on its own dispatcher thread (outside epoll_wait), computes 1.0 - idle / delta_wall directly over completed idle intervals and resets accumulated idle time without cross-window carry-over.

Additional Description:
Part 2 of a 4-PR series introducing the envoy.resource_monitors.adaptive_worker_capacity synchronous-feedback resource monitor (#49325, building on #47607 and #46101):

  1. DynamicTokenBucket (resource_monitors: add DynamicTokenBucket for adaptive worker capacity #49323, merged)
  2. This PR: WorkerUtilizationTracker
  3. RefillRateController (log-linear refill-rate adaptation)
  4. AdaptiveWorkerCapacityMonitor, v3 config API, factory registration, integration test, and docs

Generative AI disclosure: Assisted by generative AI tooling; reviewed and verified by the author.

Risk Level: Low
Testing: Unit tests in //test/extensions/resource_monitors/adaptive_worker_capacity:worker_utilization_tracker_test
Docs Changes: N/A (included with extension registration in Part 4)
Release Notes: N/A (included with extension registration in Part 4)
Platform Specific Features: N/A
#49325

…ation

Signed-off-by: antoniovleonti <leonti@google.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #49399 was opened by antoniovleonti.

see: more, trace.

…tionTracker

Signed-off-by: antoniovleonti <leonti@google.com>
…ed idle polls

Signed-off-by: antoniovleonti <leonti@google.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant