-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpeerUtil.go
More file actions
39 lines (35 loc) · 816 Bytes
/
peerUtil.go
File metadata and controls
39 lines (35 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package p2p
import (
"time"
)
// PeerMetrics is the data shared to the metrics hook
type PeerMetrics struct {
Hash string
PeerAddress string
MomentConnected time.Time
PeerQuality int32
LastReceive time.Time
LastSend time.Time
MessagesSent uint64
BytesSent uint64
MessagesReceived uint64
BytesReceived uint64
Incoming bool
PeerType string
ConnectionState string
MPSDown float64
MPSUp float64
BPSDown float64
BPSUp float64
SendFillRatio float64
Dropped uint64
}
// peerStatus is an indicator for peer manager whether the associated peer is going online or offline
type peerStatus struct {
peer *Peer
online bool
}
type peerParcel struct {
peer *Peer
parcel *Parcel
}