Expand description
Periodic-summary entity-SET/DEL instrumentation.
Replaces the per-set/del tracing::debug!("[entity] SET|DEL {} id={}", ...)
lines in [ServerContext], which fire tens of thousands of times per second
under pulse-heavy workloads (e.g. comp-engine field/cap presence pulses) and
dominate log I/O.
The hot path increments a per-entity-type atomic counter (SET and DEL kept
separate) via a DashMap entry lookup; a single dedicated thread emits one
summary log line every WINDOW_MS. Quiet windows emit nothing.
Mirrors the super::report_cache_stats pattern. To silence even the
summary, set RUST_LOG=myko::server::entity_set_stats=off.
Functions§
- record_
del - Record a single entity
DELforentity_type. Counted separately fromSETso the summary distinguishes churn from removal. - record_
set - Record a single entity
SETforentity_type. Cheap: one DashMap lookup plus a relaxed atomic increment. - start_
periodic_ logger - Spawn the summary thread. Idempotent.