pub struct DeviceBuilder { /* fields omitted */ }
デフォルト設定でDeviceBuilder
インスタンスを生成する.
メトリクス用の共通設定を登録する.
デフォルト値はMetricBuilder::new()
.
デバイスが暇だと判定するための閾値(時間)を設定する.
この値以上、新規コマンドを受信しない期間が続いた場合には、
デバイス(用のスレッド)が空いていると判断されて、
ストレージの補助タスクが実行されるようになる.
デフォルト値はDuration::from_millis(100)
.
デバイスの最大キュー長.
これを超えた数のコマンドがデバイスのキューに溜まると、
そのデバイスは致命的に過負荷であると判断され、
ErrorKind::DeviceBusy
を終了理由として停止する.
デフォルト値は100_000
.
デバイスが最大継続ビジー時間.
これを超えてビジーな状態が続いた場合には、何か異常が発生しているものと判断され、
ErrorKind::DeviceBusy
の終了理由でデバイスが停止する.
ビジー状態かどうかの判断にはbusy_threshold
の値を用いる.
デフォルト値はDuration::from_secs(600)
.
デバイスがビジー状態かどうかを判定するための閾値.
コマンドのキューの長さがこの値を超えている場合には、
そのデバイスはビジー状態であるとみなされる.
デバイス側は、特定のコマンドの優先度等は分からないため、
ビジー状態だからといってコマンドを拒否することはないが、
この状態が一定(max_keep_busy_duration
)以上継続した場合には、
そのデバイスが何かしらの異常により過負荷に陥っていると判断して、
停止させられる.
デフォルト値は1_000
.
指定されたストレージを扱うDevice
を起動する.
起動したデバイス用に、一つの専用OSスレッドが割り当てられる.
なお、スレッド起動後には、まずinit_storage()
が呼び出されて、
ストレージインスタンスが生成される.
返り値のDevice
インスタンスが破棄されると、
起動したデバイススレッドも停止させられるので注意が必要.
Returns the "default value" for a type. Read more
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static