Commit ae0fcc6b authored by vyzo's avatar vyzo

add traces for send/drop rpc

forgotten!
parent 151ec256
......@@ -152,15 +152,41 @@ func (t *pubsubTracer) RecvRPC(rpc *RPC) {
}
func (t *pubsubTracer) SendRPC(rpc *RPC, p peer.ID) {
if t != nil {
// TODO
if t == nil {
return
}
now := time.Now().UnixNano()
evt := &pb.TraceEvent{
Type: pb.TraceEvent_SEND_RPC.Enum(),
PeerID: []byte(t.pid),
Timestamp: &now,
SendRPC: &pb.TraceEvent_SendRPC{
SendTo: []byte(rpc.from),
Meta: traceRPCMeta(rpc),
},
}
t.tracer.Trace(evt)
}
func (t *pubsubTracer) DropRPC(rpc *RPC, p peer.ID) {
if t != nil {
// TODO
if t == nil {
return
}
now := time.Now().UnixNano()
evt := &pb.TraceEvent{
Type: pb.TraceEvent_DROP_RPC.Enum(),
PeerID: []byte(t.pid),
Timestamp: &now,
DropRPC: &pb.TraceEvent_DropRPC{
SendTo: []byte(rpc.from),
Meta: traceRPCMeta(rpc),
},
}
t.tracer.Trace(evt)
}
func traceRPCMeta(rpc *RPC) *pb.TraceEvent_RPCMeta {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment