Documentation ¶
Index ¶
- Variables
- type Cache
- type CacheStorage
- type Client
- type Config
- type Service
- func (s *Service) GetDailyStorageUsage(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []storageusage.Stamp, err error)
- func (s *Service) GetPricingModel(ctx context.Context, satelliteID storj.NodeID) (_ *pricing.Pricing, err error)
- func (s *Service) GetReputationStats(ctx context.Context, satelliteID storj.NodeID) (_ *reputation.Stats, err error)
Constants ¶
This section is empty.
Variables ¶
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 { Reputation *sync2.Cycle Storage *sync2.Cycle // 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, heldamountEndpoint *heldamount.Endpoint, heldamountService *heldamount.Service, 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) 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 HeldAmount heldamount.DB Pricing pricing.DB Satellites satellites.DB }
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"` 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.
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) GetPricingModel ¶ added in v1.3.2
func (s *Service) GetPricingModel(ctx context.Context, satelliteID storj.NodeID) (_ *pricing.Pricing, err error)
GetPricingModel returns pricing model of specific 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.