diff --git a/docs/api/file-sink-policy-to-json.md b/docs/api/file-sink-policy-to-json.md index 666b23d..f6d86ee 100644 --- a/docs/api/file-sink-policy-to-json.md +++ b/docs/api/file-sink-policy-to-json.md @@ -56,10 +56,11 @@ In this example, the runtime file policy becomes a reusable structured value. When current and default policy should be exported separately: ```moonbit -let current = file_sink_policy_to_json(sink.policy()) +let current = file_sink_policy_to_json(runtime.file_policy()) +let defaults = file_sink_policy_to_json(runtime.file_default_policy()) ``` -In this example, callers can compare policy snapshots without formatting text first. +In this example, callers can compare current and default policy snapshots without formatting text first. ### Error Case diff --git a/docs/api/file-sink-state-to-json.md b/docs/api/file-sink-state-to-json.md index da350bc..ab4cfc5 100644 --- a/docs/api/file-sink-state-to-json.md +++ b/docs/api/file-sink-state-to-json.md @@ -56,10 +56,10 @@ In this example, callers receive a structured file-state snapshot instead of pla When support tooling should ingest file sink state programmatically: ```moonbit -let snapshot = file_sink_state_to_json(state) +let snapshot = file_sink_state_to_json(runtime.file_state()) ``` -In this example, the helper exposes all major file-state fields in machine-readable form. +In this example, the helper exposes all major live file-state fields in machine-readable form. ### Error Case diff --git a/docs/api/runtime-file-state-to-json.md b/docs/api/runtime-file-state-to-json.md index fad6674..602fde3 100644 --- a/docs/api/runtime-file-state-to-json.md +++ b/docs/api/runtime-file-state-to-json.md @@ -55,10 +55,16 @@ In this example, callers receive a machine-readable combined runtime snapshot. When queued file runtime data should be embedded into a larger JSON object: ```moonbit -let payload = runtime_file_state_to_json(state) +match runtime.file_runtime_state() { + Some(snapshot) => { + let payload = runtime_file_state_to_json(snapshot) + ignore(payload) + } + None => () +} ``` -In this example, the helper keeps file-plus-queue diagnostics in one reusable JSON value. +In this example, the helper keeps file-plus-queue diagnostics in one reusable JSON value after the optional runtime snapshot is read. ### Error Case diff --git a/docs/api/stringify-runtime-file-state.md b/docs/api/stringify-runtime-file-state.md index 5c8998a..db594b0 100644 --- a/docs/api/stringify-runtime-file-state.md +++ b/docs/api/stringify-runtime-file-state.md @@ -48,10 +48,13 @@ Here are some specific examples provided. When a queued file runtime snapshot should be printed directly: ```moonbit -println(stringify_runtime_file_state(snapshot, pretty=true)) +match runtime.file_runtime_state() { + Some(snapshot) => println(stringify_runtime_file_state(snapshot, pretty=true)) + None => () +} ``` -In this example, both file state and queue metrics are shown in one readable JSON payload. +In this example, both file state and queue metrics are shown in one readable JSON payload after the optional runtime snapshot is checked. #### When Need Compact Runtime Snapshot Export