/// Log a new component event to inspect.
Log a new component event to inspect.
Log a new component event to inspect .
pub fn log(&mut self, event: &Event) {
        let ty = event.ty();
        if self.counters.contains_key(&ty) {
            self.counters.get_mut(&ty).unwrap().add(1);
        } else {
            let counter = self.counters_node.create_uint(ty.as_ref(), 1);
            self.counters.insert(ty.clone(), counter);
        }
        // TODO(fxbug.dev/92374): leverage string references for the payload.
        match &event.payload {
            EventPayload::ComponentStarted(ComponentStartedPayload { component })
            | EventPayload::ComponentStopped(ComponentStoppedPayload { component })
            | EventPayload::DiagnosticsReady(DiagnosticsReadyPayload { component, .. })
            | EventPayload::LogSinkRequested(LogSinkRequestedPayload { component, .. }) => {
                self.log_inspect(ty.as_ref(), component);
            }
        }
    }
pub fn log ( & mut self , event : & Event ) { let ty = event . ty ( ) ; if self . counters . contains_key ( & ty ) { self . counters . get_mut ( & ty ) . unwrap ( ) . add ( 1 ) ; } else { let counter = self . counters_node . create_uint ( ty . as_ref ( ) , 1 ) ; self . counters . insert ( ty . clone ( ) , counter ) ; } // TODO(fxbug.dev/92374): leverage string references for the payload. match & event . payload { EventPayload :: ComponentStarted ( ComponentStartedPayload { component } ) | EventPayload :: ComponentStopped ( ComponentStoppedPayload { component } ) | EventPayload :: DiagnosticsReady ( DiagnosticsReadyPayload { component , .. } ) | EventPayload :: LogSinkRequested ( LogSinkRequestedPayload { component , .. } ) => { self . log_inspect ( ty . as_ref ( ) , component ) ; } } }
Log a new component event to inspect.
Log a new component event to inspect .
&mut self
event
&Event