attachToObserver static method
Attaches metrics collection to JObserver for automatic tracking.
Registers a JObserverDelegate, so it coexists with other observers and callbacks. Calling it again is a no-op; detachFromObserver unregisters it. This tracks:
intent.dispatched,intent.failed,intent.cancelledandintent.droppedcounters, tagged by typeintent.execution.durationtimers (microseconds) covering JIntent.onInvoke only; time spent waiting in a dispatcher queue is not includedstate.changedandeffect.emittedcounters
Effect completion time is not measured.
Implementation
static void attachToObserver() {
if (!_enabled) {
enable();
}
JObserver.addObserver(_observer);
}