trace peer exchange

This commit is contained in:
vyzo 2019-11-23 17:08:05 +02:00
parent 95d3bbfa1b
commit 2e7cdebf34
3 changed files with 692 additions and 802 deletions

File diff suppressed because it is too large Load Diff

View File

@ -137,6 +137,7 @@ message TraceEvent {
message ControlPruneMeta {
optional string topic = 1;
repeated bytes peers = 2;
}
}

View File

@ -246,8 +246,13 @@ func (t *pubsubTracer) traceRPCMeta(rpc *RPC) *pb.TraceEvent_RPCMeta {
var prune []*pb.TraceEvent_ControlPruneMeta
for _, ctl := range rpc.Control.Prune {
peers := make([][]byte, 0, len(ctl.Peers))
for _, pi := range ctl.Peers {
peers = append(peers, pi.PeerID)
}
prune = append(prune, &pb.TraceEvent_ControlPruneMeta{
Topic: ctl.TopicID,
Peers: peers,
})
}