Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NodeStatsCacheErr defines node stats cache loop error NodeStatsCacheErr = errs.Class("node stats cache error") )
var ( // NodeStatsServiceErr defines node stats service error NodeStatsServiceErr = errs.Class("node stats service error") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.18.0
type Cache struct {
// 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, trust *trust.Pool) *Cache
NewCache creates new caching service instance
func (*Cache) CacheReputationStats ¶ added in v0.18.0
CacheReputationStats queries node stats from all the satellites known to the storagenode and stores information 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
type CacheStorage struct { Reputation reputation.DB StorageUsage storageusage.DB }
CacheStorage encapsulates cache DBs
type Client ¶
type Client struct { pb.NodeStatsClient // 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"` 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 GRPC client
architecture: Service
func NewService ¶
NewService creates new instance of service
func (*Service) GetDailyStorageUsage ¶ added in v0.18.0
func (s *Service) GetDailyStorageUsage(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []storageusage.Stamp, err error)
GetDailyStorageUsage returns daily storage usage over a period of time for a particular satellite
func (*Service) GetReputationStats ¶ added in v0.18.0
func (s *Service) GetReputationStats(ctx context.Context, satelliteID storj.NodeID) (_ *reputation.Stats, err error)
GetReputationStats retrieves reputation stats from particular satellite