Documentation
¶
Index ¶
- Variables
- type Config
- type Tally
- func (t *Tally) QueryBW(ctx context.Context) (time.Time, map[storj.NodeID][]int64, error)
- func (t *Tally) Run(ctx context.Context) (err error)
- func (t *Tally) SaveAtRestRaw(ctx context.Context, latestTally time.Time, created time.Time, ...) error
- func (t *Tally) SaveBWRaw(ctx context.Context, tallyEnd time.Time, created time.Time, ...) error
- func (t *Tally) Tally(ctx context.Context) error
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 tally should run" default:"1h" devDefault:"30s"`
}
Config contains configurable values for tally
type Tally ¶
type Tally struct {
// contains filtered or unexported fields
}
Tally is the service for accounting for data stored on each storage node
func New ¶
func New(logger *zap.Logger, accountingDB accounting.DB, bwAgreementDB bwagreement.DB, pointerdb *pointerdb.Service, overlay *overlay.Cache, limit int, interval time.Duration) *Tally
New creates a new Tally
func (*Tally) QueryBW ¶
QueryBW queries bandwidth allocation database, selecting all new contracts since the last collection run time. Grouping by action type, storage node ID and adding total of bandwidth to granular data table.
func (*Tally) SaveAtRestRaw ¶
func (t *Tally) SaveAtRestRaw(ctx context.Context, latestTally time.Time, created time.Time, nodeData map[storj.NodeID]float64) error
SaveAtRestRaw records raw tallies of at-rest-data and updates the LastTimestamp
Click to show internal directories.
Click to hide internal directories.