-
Notifications
You must be signed in to change notification settings - Fork 4
Add Scheduler and TokenBucket metrics #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/metrics
Are you sure you want to change the base?
Conversation
pub(crate) struct TokenBucketMetrics { | ||
max_tokens: u64, | ||
available_tokens: UpDownCounter, | ||
token_wait_time: Histogram, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this will be meaningful or not given permit requests come with different token amounts requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if tracking percentage of available tokens over time or something would be more useful?
aws-sdk-s3-transfer-manager/src/middleware/limit/concurrency/future.rs
Outdated
Show resolved
Hide resolved
// NOTE: tokio semaphore is fair, permits are given out in the order requested | ||
semaphore: Arc<Semaphore>, | ||
mode: ConcurrencyMode, | ||
tb_metrics: Arc<TokenBucketMetrics>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kind of wondering whether token bucket metrics provide value at this point in time. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also not sure, but will probably leave them in place until I can actually run some benchmarks and test all of this on some real use cases. Can remove if we find it not necessary after that testing.
Remove permit acquisition/release tracking and simplify inflight request monitoring with consistent counter types.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.