pub struct CompactionDebtTracker { /* private fields */ }Expand description
コンパクション負債を追跡する。
Implementations§
Source§impl CompactionDebtTracker
impl CompactionDebtTracker
Sourcepub fn new(config: WriteThrottleConfig) -> Self
pub fn new(config: WriteThrottleConfig) -> Self
新規トラッカーを作成する。
Sourcepub fn add_pending(&self, bytes: u64)
pub fn add_pending(&self, bytes: u64)
ペンディングセクションを追加する。
Sourcepub fn complete_pending(&self, bytes: u64)
pub fn complete_pending(&self, bytes: u64)
ペンディングセクションを完了する。
Sourcepub fn should_throttle(&self) -> bool
pub fn should_throttle(&self) -> bool
スロットリングが必要か判定する。
Sourcepub fn debt_ratio(&self) -> f64
pub fn debt_ratio(&self) -> f64
現在の負債率を返す(0.0-1.0超の可能性あり)。
Sourcepub fn throttle_duration(&self) -> Duration
pub fn throttle_duration(&self) -> Duration
スロットリング待機時間を返す(指数バックオフ)。
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CompactionDebtTracker
impl RefUnwindSafe for CompactionDebtTracker
impl Send for CompactionDebtTracker
impl Sync for CompactionDebtTracker
impl Unpin for CompactionDebtTracker
impl UnsafeUnpin for CompactionDebtTracker
impl UnwindSafe for CompactionDebtTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more