MCPcopy Create free account
hub / github.com/GCWing/BitFun / record_event

Method record_event

src/apps/desktop/src/startup_trace.rs:116–142  ·  view source on GitHub ↗
(
        &self,
        phase: String,
        category: Option<String>,
        step: Option<String>,
        command: Option<String>,
        target: Option<String>,
        duration_ms: Option<u12

Source from the content-addressed store, hash-verified

114 }
115
116 fn record_event(
117 &self,
118 phase: String,
119 category: Option<String>,
120 step: Option<String>,
121 command: Option<String>,
122 target: Option<String>,
123 duration_ms: Option<u128>,
124 ) {
125 let since_process_start_ms = to_u64(elapsed_ms(self.started_at));
126 let duration_ms = duration_ms.map(to_u64);
127 let event = DesktopStartupTraceEvent {
128 trace_id: self.trace_id.clone(),
129 phase,
130 at_ms: since_process_start_ms,
131 since_process_start_ms,
132 category,
133 step,
134 command,
135 target,
136 duration_ms,
137 };
138
139 if let Ok(mut events) = self.events.lock() {
140 events.push(event);
141 }
142 }
143}
144
145fn to_u64(value: u128) -> u64 {

Callers 3

record_phaseMethod · 0.45
record_stepMethod · 0.45

Calls 4

to_u64Function · 0.85
elapsed_msFunction · 0.85
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected