tally

package
v0.24.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = errs.Class("tally error")
)

Error is a standard error class for this package.

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval time.Duration `help:"how frequently the tally service should run" releaseDefault:"1h" devDefault:"30s"`
}

Config contains configurable values for the tally service

type Observer added in v0.23.0

type Observer struct {
	Log    *zap.Logger
	Node   map[storj.NodeID]float64
	Bucket map[string]*accounting.BucketTally
}

Observer observes metainfo and adds up tallies for nodes and buckets

func NewObserver added in v0.23.0

func NewObserver(log *zap.Logger) *Observer

NewObserver returns an metainfo loop observer that adds up totals for buckets and nodes.

func (*Observer) InlineSegment added in v0.23.0

func (observer *Observer) InlineSegment(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

InlineSegment is called for each inline segment.

func (*Observer) Object added in v0.23.0

func (observer *Observer) Object(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

Object is called for each object once.

func (*Observer) RemoteSegment added in v0.23.0

func (observer *Observer) RemoteSegment(ctx context.Context, path metainfo.ScopedPath, pointer *pb.Pointer) (err error)

RemoteSegment is called for each remote segment.

type Service

type Service struct {
	Loop sync2.Cycle
	// contains filtered or unexported fields
}

Service is the tally service for data stored on each storage node

architecture: Chore

func New

func New(log *zap.Logger, sdb accounting.StoragenodeAccounting, pdb accounting.ProjectAccounting, liveAccounting accounting.Cache, metainfoLoop *metainfo.Loop, interval time.Duration) *Service

New creates a new tally Service

func (*Service) Close added in v0.21.0

func (service *Service) Close() error

Close stops the service and releases any resources.

func (*Service) Run

func (service *Service) Run(ctx context.Context) (err error)

Run the tally service loop

func (*Service) Tally

func (service *Service) Tally(ctx context.Context) (err error)

Tally calculates data-at-rest usage once

Jump to

Keyboard shortcuts

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