MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / get_instance_handshakes

Method get_instance_handshakes

gateway/src/kv/mod.rs:603–613  ·  view source on GitHub ↗

Get all handshake observations for an instance (from all nodes)

(&self, instance_id: &str)

Source from the content-addressed store, hash-verified

601
602 /// Get all handshake observations for an instance (from all nodes)
603 pub fn get_instance_handshakes(&self, instance_id: &str) -> BTreeMap<NodeId, u64> {
604 self.ephemeral
605 .read()
606 .iter_decoded(&keys::handshake_prefix(instance_id))
607 .filter_map(|(key, ts)| {
608 let suffix = key.strip_prefix(&keys::handshake_prefix(instance_id))?;
609 let observer: NodeId = suffix.parse().ok()?;
610 Some((observer, ts))
611 })
612 .collect()
613 }
614
615 /// Get the latest handshake timestamp for an instance (max across all nodes)
616 pub fn get_instance_latest_handshake(&self, instance_id: &str) -> Option<u64> {

Callers

nothing calls this directly

Calls 3

handshake_prefixFunction · 0.85
iter_decodedMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected