p2p: measure subprotocol bandwidth usage

This commit is contained in:
Péter Szilágyi
2019-09-27 17:41:47 +03:00
parent df89233b57
commit a2a60869c8
3 changed files with 19 additions and 1 deletions

View File

@ -39,9 +39,13 @@ import (
// separate Msg with a bytes.Reader as Payload for each send.
type Msg struct {
Code uint64
Size uint32 // size of the paylod
Size uint32 // Size of the raw payload
Payload io.Reader
ReceivedAt time.Time
meterCap Cap // Protocol name and version for egress metering
meterCode uint64 // Message within protocol for egress metering
meterSize uint32 // Compressed message size for ingress metering
}
// Decode parses the RLP content of a message into