nodestats

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NodeStatsServiceErr defines node stats service error
	NodeStatsServiceErr = errs.Class("node stats service error")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	pb.NodeStatsClient
	// contains filtered or unexported fields
}

Client encapsulates NodeStatsClient with underlying connection

func (*Client) Close

func (c *Client) Close() error

Close closes underlying client connection

type ReputationStats

type ReputationStats struct {
	TotalCount   int64
	SuccessCount int64

	ReputationAlpha float64
	ReputationBeta  float64
	ReputationScore float64
}

ReputationStats encapsulates storagenode reputation metrics

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service retrieves info from satellites using GRPC client

func NewService

func NewService(log *zap.Logger, transport transport.Client, kademlia *kademlia.Kademlia) *Service

NewService creates new instance of service

func (*Service) DialNodeStats

func (s *Service) DialNodeStats(ctx context.Context, satelliteID storj.NodeID) (*Client, error)

DialNodeStats dials GRPC NodeStats client for the satellite by id

func (*Service) GetDailyStorageUsedForSatellite

func (s *Service) GetDailyStorageUsedForSatellite(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []SpaceUsageStamp, err error)

GetDailyStorageUsedForSatellite returns daily SpaceUsageStamps over a period of time for a particular satellite

func (*Service) GetStatsFromSatellite

func (s *Service) GetStatsFromSatellite(ctx context.Context, satelliteID storj.NodeID) (_ *Stats, err error)

GetStatsFromSatellite retrieves node stats from particular satellite

type SpaceUsageStamp

type SpaceUsageStamp struct {
	SatelliteID storj.NodeID
	AtRestTotal float64

	TimeStamp time.Time
}

SpaceUsageStamp is space usage for satellite at some point in time

type Stats

type Stats struct {
	SatelliteID storj.NodeID

	UptimeCheck ReputationStats
	AuditCheck  ReputationStats
}

Stats encapsulates storagenode stats retrieved from the satellite

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL