Source File
reporter.go
Belonging Package
github.com/libp2p/go-libp2p/core/metrics
// Package metrics provides metrics collection and reporting interfaces for libp2p.package metricsimport ()// Stats represents a point-in-time snapshot of bandwidth metrics.//// The TotalIn and TotalOut fields record cumulative bytes sent / received.// The RateIn and RateOut fields record bytes sent / received per second.type Stats struct {TotalIn int64TotalOut int64RateIn float64RateOut float64}// Reporter provides methods for logging and retrieving metrics.type Reporter interface {LogSentMessage(int64)LogRecvMessage(int64)LogSentMessageStream(int64, protocol.ID, peer.ID)LogRecvMessageStream(int64, protocol.ID, peer.ID)GetBandwidthForPeer(peer.ID) StatsGetBandwidthForProtocol(protocol.ID) StatsGetBandwidthTotals() StatsGetBandwidthByPeer() map[peer.ID]StatsGetBandwidthByProtocol() map[protocol.ID]Stats}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |