feat: add debug-level per-op, session and link metrics
This commit is contained in:
parent
0ba9f32837
commit
07f064460f
5 changed files with 76 additions and 0 deletions
|
|
@ -280,6 +280,7 @@ extern "C" fn smolmail_rns_on_link_opened(link_id: *const u8) -> i32 {
|
|||
return 1;
|
||||
}
|
||||
links.insert(link);
|
||||
log::debug!("link {} opened ({} open)", data_encoding::HEXLOWER.encode(&link), links.len());
|
||||
0
|
||||
}
|
||||
|
||||
|
|
@ -289,6 +290,7 @@ extern "C" fn smolmail_rns_on_link_closed(link_id: *const u8) {
|
|||
let link: [u8; 16] = unsafe { std::slice::from_raw_parts(link_id, 16).try_into().unwrap() };
|
||||
state.links.lock().unwrap().remove(&link);
|
||||
state.sessions.lock().unwrap().remove(&link);
|
||||
log::debug!("link {} closed", data_encoding::HEXLOWER.encode(&link));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue