Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NodeStatsServiceErr defines node stats service error. NodeStatsServiceErr = errs.Class("nodestats") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.18.0
type Cache struct { Storage *sync2.Cycle UsageStat *UsageStat // contains filtered or unexported fields }
Cache runs cache loop and stores reputation stats and storage usage into db.
architecture: Chore
func NewCache ¶ added in v0.18.0
func NewCache(log *zap.Logger, config Config, db CacheStorage, service *Service, payoutEndpoint *payouts.Endpoint, trust *trust.Pool) *Cache
NewCache creates new caching service instance.
func (*Cache) CacheHeldAmount ¶ added in v0.35.2
CacheHeldAmount queries held amount stats and payments from all the satellites known to the storagenode and stores info into db.
func (*Cache) CacheSpaceUsage ¶ added in v0.18.0
CacheSpaceUsage queries disk space usage from all the satellites known to the storagenode and stores information into db.
type CacheStorage ¶ added in v0.18.0
CacheStorage encapsulates cache DBs.
type Client ¶
type Client struct { pb.DRPCNodeStatsClient // contains filtered or unexported fields }
Client encapsulates NodeStatsClient with underlying connection.
architecture: Client
type Config ¶ added in v0.18.0
type Config struct { MaxSleep time.Duration `help:"maximum duration to wait before requesting data" releaseDefault:"300s" devDefault:"1s"` ReputationSync time.Duration `help:"how often to sync reputation" releaseDefault:"4h" devDefault:"1m" deprecated:"use --reputation.interval" hidden:"true"` StorageSync time.Duration `help:"how often to sync storage" releaseDefault:"12h" devDefault:"2m"` }
Config defines nodestats cache configuration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service retrieves info from satellites using an rpc client.
architecture: Service
func NewService ¶
NewService creates new instance of service.
type UsageStat ¶ added in v1.98.1
type UsageStat struct {
// contains filtered or unexported fields
}
UsageStat caches last space usage value for each satellite, to make it available for monkit.
func NewUsageStat ¶ added in v1.98.1
func NewUsageStat() *UsageStat
NewUsageStat initializes a UsageState.