Yex.MemDebug (y_ex v0.10.6)
View SourceNative (Rust NIF) memory debugging counters for y_ex.
Counters track hot paths in the NIF layer: doc creation, subdoc map integration, YDoc reads, update encoding, subscriptions, etc.
Build y_ex from source when using this module:
RUSTLER_PRECOMPILATION_YEX_BUILD=true mix deps.compile y_ex --forceOr set the same env var when starting the application.
Summary
Functions
Enable or disable native counter recording.
Encode full document update and return {:ok, byte_size, binary}.
Inspect yrs store size metrics for a document.
Append an NDJSON line with native snapshot to path.
Optional extra map is merged into the JSON payload.
Reset all native counters to zero.
Return current native counter snapshot.
Return snapshot fields as a plain map (snake_case keys).
Types
@type doc_info() :: %{ guid: String.t(), client_id: non_neg_integer(), skip_gc: boolean(), auto_load: boolean(), state_vector_bytes: non_neg_integer(), update_encode_bytes: non_neg_integer(), has_worker_pid: boolean() }
@type snapshot() :: %{ enabled: boolean(), doc_new: non_neg_integer(), doc_with_options: non_neg_integer(), map_set_doc: non_neg_integer(), map_set_null: non_neg_integer(), map_set_other: non_neg_integer(), yout_ydoc_wrap: non_neg_integer(), monitor_update_v1: non_neg_integer(), monitor_update_v2: non_neg_integer(), monitor_subdocs: non_neg_integer(), sub_unsubscribe: non_neg_integer(), encode_state_as_update: non_neg_integer(), apply_update: non_neg_integer(), transaction_begin: non_neg_integer(), transaction_commit: non_neg_integer(), net_subdoc_integrations: integer() }
Functions
@spec enable(boolean()) :: :ok
Enable or disable native counter recording.
@spec encode_update_size(Yex.Doc.t()) :: {:ok, non_neg_integer(), binary()}
Encode full document update and return {:ok, byte_size, binary}.
Inspect yrs store size metrics for a document.
Append an NDJSON line with native snapshot to path.
Optional extra map is merged into the JSON payload.
@spec reset() :: :ok
Reset all native counters to zero.
@spec snapshot() :: snapshot()
Return current native counter snapshot.
@spec snapshot_map() :: map()
Return snapshot fields as a plain map (snake_case keys).