console

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SNOServiceErr defines sno service error
	SNOServiceErr = errs.Class("storage node dashboard service error")
)

Functions

This section is empty.

Types

type BandwidthInfo

type BandwidthInfo struct {
	Egress    Egress  `json:"egress"`
	Ingress   Ingress `json:"ingress"`
	Used      int64   `json:"used"`
	Remaining int64   `json:"remaining"`
}

BandwidthInfo stores all info about storage node bandwidth usage

func FromUsage

func FromUsage(usage *bandwidth.Usage, allocatedBandwidth int64) (*BandwidthInfo, error)

FromUsage used to create BandwidthInfo instance from Usage object

type BandwidthUsed added in v0.15.0

type BandwidthUsed struct {
	Egress  Egress  `json:"egress"`
	Ingress Ingress `json:"ingress"`

	From, To time.Time
}

BandwidthUsed stores bandwidth usage information over the period of time

type DB

type DB interface {
	// GetSatelliteIDs returns list of satelliteIDs that storagenode has interacted with
	// at least once
	GetSatelliteIDs(ctx context.Context, from, to time.Time) (storj.NodeIDList, error)
	// GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range,
	// sorted in ascending order
	GetDailyTotalBandwidthUsed(ctx context.Context, from, to time.Time) ([]BandwidthUsed, error)
	// GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range,
	// sorted in ascending order for particular satellite
	GetDailyBandwidthUsed(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) ([]BandwidthUsed, error)
}

DB exposes methods for managing SNO dashboard related data.

type DiskSpaceInfo

type DiskSpaceInfo struct {
	Available int64 `json:"available"`
	Used      int64 `json:"used"`
}

DiskSpaceInfo stores all info about storagenode disk space usage

type Egress

type Egress struct {
	Repair int64 `json:"repair"`
	Audit  int64 `json:"audit"`
	Usage  int64 `json:"usage"`
}

Egress stores info about storage node egress usage

type Ingress

type Ingress struct {
	Repair int64 `json:"repair"`
	Usage  int64 `json:"usage"`
}

Ingress stores info about storage node ingress usage

type Service

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

Service is handling storage node operator related logic

func NewService

func NewService(log *zap.Logger, consoleDB DB, bandwidth bandwidth.DB, pieceInfo pieces.DB, kademlia *kademlia.Kademlia, version *version.Service,
	nodestats *nodestats.Service, allocatedBandwidth, allocatedDiskSpace memory.Size, walletAddress string, versionInfo version.Info) (*Service, error)

NewService returns new instance of Service

func (*Service) CheckVersion

func (s *Service) CheckVersion(ctx context.Context) (err error)

CheckVersion checks to make sure the version is still okay, returning an error if not

func (*Service) GetBandwidthBySatellite

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

GetBandwidthBySatellite returns all info about storage node bandwidth usage by satellite

func (*Service) GetDailyBandwidthUsed added in v0.15.0

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

GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range, sorted in ascending order for particular satellite

func (*Service) GetDailyStorageUsedForSatellite added in v0.15.0

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

GetDailyStorageUsedForSatellite returns daily SpaceUsageStamps for a particular satellite

func (*Service) GetDailyTotalBandwidthUsed added in v0.15.0

func (s *Service) GetDailyTotalBandwidthUsed(ctx context.Context, from, to time.Time) (_ []BandwidthUsed, err error)

GetDailyTotalBandwidthUsed returns slice of daily bandwidth usage for provided time range, sorted in ascending order

func (*Service) GetNodeID

func (s *Service) GetNodeID(ctx context.Context) storj.NodeID

GetNodeID return current node id

func (*Service) GetSatellites

func (s *Service) GetSatellites(ctx context.Context) (_ storj.NodeIDList, err error)

GetSatellites used to retrieve satellites list

func (*Service) GetStatsFromSatellite added in v0.15.0

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

GetStatsFromSatellite returns storagenode stats from the satellite

func (*Service) GetUptime

func (s *Service) GetUptime(ctx context.Context) time.Duration

GetUptime returns current storagenode uptime

func (*Service) GetUsedBandwidthTotal

func (s *Service) GetUsedBandwidthTotal(ctx context.Context) (_ *BandwidthInfo, err error)

GetUsedBandwidthTotal returns all info about storage node bandwidth usage

func (*Service) GetUsedStorageBySatellite

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

GetUsedStorageBySatellite returns all info about storagenode disk space usage

func (*Service) GetUsedStorageTotal

func (s *Service) GetUsedStorageTotal(ctx context.Context) (_ *DiskSpaceInfo, err error)

GetUsedStorageTotal returns all info about storagenode disk space usage

func (*Service) GetVersion

func (s *Service) GetVersion(ctx context.Context) version.Info

GetVersion return current node version

func (*Service) GetWalletAddress

func (s *Service) GetWalletAddress(ctx context.Context) string

GetWalletAddress return wallet address of node operator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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