Skip to main content

monitor.create(container, options?)

MonitorOptions

MonitorEventType[]
default:"[\"all\"]"
Filter events. Values: register, resolve, error, import, clear, all.
boolean
default:"true"
Log filtered events to console.info with [DI:type] prefix.
number
default:"100"
Ring buffer size. Oldest events are dropped when exceeded.

ContainerMonitor methods

start()

Attaches to container.observe. Called automatically by the constructor. Idempotent.

stop()

Unsubscribes from container events. Call when monitoring is no longer needed to reduce resolve overhead.

clearHistory()

Empties the in-memory event buffer without stopping observation.

getEvents()

Returns a shallow copy of buffered ContainerEvent[]:

getStats()

resolveSuccessRate inspects details.success on resolve events.

Console output format

Example: test assertions

Import paths

All resolve to the same implementation.