MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / count

Method count

nodedb/src/control/security/session_handle/store.rs:228–232  ·  view source on GitHub ↗

Number of active (non-expired) handles.

(&self)

Source from the content-addressed store, hash-verified

226
227 /// Number of active (non-expired) handles.
228 pub fn count(&self) -> usize {
229 let now = now_secs();
230 let sessions = self.sessions.read().unwrap_or_else(|p| p.into_inner());
231 sessions.values().filter(|s| now < s.expires_at).count()
232 }
233
234 /// Age of the oldest active session handle in seconds.
235 pub fn oldest_age_secs(&self) -> u64 {

Callers 1

Calls 2

now_secsFunction · 0.70
readMethod · 0.45

Tested by 1