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

Function build_store_status

gateway/src/admin_service.rs:700–730  ·  view source on GitHub ↗
(
    name: &str,
    status: WaveKvNodeStatus,
    get_peer_last_seen: &impl Fn(u32) -> Vec<(u32, u64)>,
)

Source from the content-addressed store, hash-verified

698}
699
700fn build_store_status(
701 name: &str,
702 status: WaveKvNodeStatus,
703 get_peer_last_seen: &impl Fn(u32) -> Vec<(u32, u64)>,
704) -> StoreSyncStatus {
705 StoreSyncStatus {
706 name: name.to_string(),
707 node_id: status.id,
708 n_keys: status.n_kvs as u64,
709 next_seq: status.next_seq,
710 dirty: status.dirty,
711 wal_enabled: status.wal,
712 peers: status
713 .peers
714 .into_iter()
715 .map(|p| {
716 let last_seen = get_peer_last_seen(p.id)
717 .into_iter()
718 .map(|(node_id, timestamp)| LastSeenEntry { node_id, timestamp })
719 .collect();
720 ProtoPeerSyncStatus {
721 id: p.id,
722 local_ack: p.ack,
723 peer_ack: p.pack,
724 buffered_logs: p.logs as u64,
725 last_seen,
726 }
727 })
728 .collect(),
729 }
730}
731
732impl RpcCall<Proxy> for AdminRpcHandler {
733 type PrpcService = AdminServer<Self>;

Callers 1

wave_kv_statusMethod · 0.85

Calls 1

into_iterMethod · 0.80

Tested by

no test coverage detected