Skip to content

quoin-devtools

Reference1 min read
Edit page

quoin-devtools is a framework-agnostic instrumentation layer. Wrap any adapter’s ReactiveContext and every signal creation, read-triggering mutation, task spawn, and UI update request is recorded into an inspectable EventLog.

Import: use quoin_devtools::{Instrumented, EventLog, EventKind, …}; or through the facade with the devtools feature.

Module Contents
event Event, EventKind, and the ring-buffer EventLog with its aggregate views.
record The global log, the QUOIN_TRACE bootstrap, and the recording helpers shared by every wrapper.
instrumented The Instrumented context, TracedSignal, and TracedExecutor.
Item Description
Instrumented::wrap(raw_ctx, label) Drop-in wrapper around any adapter context; label names the session in events.
global_log() Access to the process-wide EventLog.
EventLog::dump() Prints a table to stderr.
EventLog::hot_signals() Ranked mutation counts per signal.
EventLog::events() Raw snapshot of Event values.
EventLog::capacity() Ring capacity (default DEFAULT_LOG_CAPACITY = 4096).
EventKind Event categories; UpdateRequested labels as "update".
enable() / disable() / enabled() Programmatic recording gate.
init_from_env() / parse_trace_flag() The QUOIN_TRACE=1 (or on) environment bootstrap.
record() / snapshot() / thread_label() Shared recording helpers.

Unless enabled() is turned on (default: the QUOIN_TRACE environment variable, or an explicit enable() call), the Instrumented wrapper short-circuits every recording call behind one relaxed atomic load, and no events are allocated.

The optional tracing feature forwards events into the tracing ecosystem.

use quoin_devtools::Instrumented;
let ctx = Instrumented::wrap(raw_ctx, "app"); // use ctx everywhere
// From a debug hotkey, a panel, or on exit:
quoin_devtools::global_log().dump(); // stderr table
quoin_devtools::global_log().hot_signals(); // ranked mutation counts
quoin_devtools::global_log().events(); // raw snapshot
Terminal
QUOIN_TRACE=1 ./myapp # enable recording from the environment