Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is the default error class for piecestore monitor errors Error = errs.Class("piecestore monitor") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Interval time.Duration `help:"how frequently Kademlia bucket should be refreshed with node stats" default:"1h0m0s"` MinimumDiskSpace memory.Size `help:"how much disk space a node at minimum has to advertise" default:"500GB"` MinimumBandwidth memory.Size `help:"how much bandwidth a node at minimum has to advertise" default:"500GB"` }
Config defines parameters for storage node disk and bandwidth usage monitoring.
type Service ¶
Service which monitors disk usage and updates kademlia network as necessary.
func NewService ¶
func NewService(log *zap.Logger, routingTable *kademlia.RoutingTable, store *pieces.Store, pieceInfo pieces.DB, usageDB bandwidth.DB, allocatedDiskSpace, allocatedBandwidth int64, interval time.Duration, config Config) *Service
NewService creates a new storage node monitoring service.
func (*Service) AvailableBandwidth ¶ added in v0.10.0
AvailableBandwidth returns available bandwidth for upload/download
func (*Service) AvailableSpace ¶ added in v0.10.0
AvailableSpace returns available disk space for upload
Click to show internal directories.
Click to hide internal directories.