1.9 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| runtime-sink-file-flush-failures | api | runtime | 20260613 | Read the number of flush failures recorded by a file-backed RuntimeSink. |
|
Runtime-sink-file-flush-failures
Read the number of flush failures recorded by a file-backed RuntimeSink. This helper is useful for direct runtime diagnostics around durability-path problems.
Interface
pub fn RuntimeSink::file_flush_failures(self : RuntimeSink) -> Int {
input
self : RuntimeSink- Runtime sink whose flush-failure counter should be inspected.
output
Int- Number of recorded flush failures.
Explanation
Detailed rules explaining key parameters and behaviors
- Plain
Fileruntime variants report the wrappedFileSinkflush-failure count. QueuedFileruntime variants forward the metric from the wrapped innerFileSink.- Non-file runtime variants return
0. - The counter is cumulative until
file_reset_failure_counters()clears it.
How to Use
Here are some specific examples provided.
When Need Durability-path Diagnostics
When support output should show flush-path instability:
let count = sink.file_flush_failures()
In this example, the runtime sink exposes whether file flush attempts have been failing.
When Inspect Effects Of Auto-flush Policy
When runtime durability tuning should be inspected operationally:
ignore(sink.file_flush_failures())
In this example, callers can correlate flush failures with direct runtime file policy choices.
Error Case
e.g.:
-
If the runtime sink is not file-backed, the method returns
0. -
If callers need current policy and counters together,
file_state()is the better API.
Notes
-
Use this helper when direct runtime flush-path reliability matters.
-
Pair it with
file_auto_flush()andfile_flush()when diagnosing durability behavior.