Documentation ¶
Overview ¶
Package bandwidth implements bandwidth usage rollup loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.16.0
type Config struct {
Interval time.Duration `help:"how frequently bandwidth usage rollups are calculated" default:"1h0m0s"`
}
Config defines parameters for storage node Collector.
type DB ¶
type DB interface { Add(ctx context.Context, satelliteID storj.NodeID, action pb.PieceAction, amount int64, created time.Time) error // MonthSummary returns summary of the current months bandwidth usages MonthSummary(ctx context.Context) (int64, error) Rollup(ctx context.Context) (err error) Summary(ctx context.Context, from, to time.Time) (*Usage, error) SummaryBySatellite(ctx context.Context, from, to time.Time) (map[storj.NodeID]*Usage, error) }
DB contains information about bandwidth usage.
type Service ¶ added in v0.16.0
Service implements
func NewService ¶ added in v0.16.0
NewService creates a new bandwidth service.
func (*Service) Close ¶ added in v0.16.0
Close stops the background process for rollups of bandwidth usage
type Usage ¶
type Usage struct { Invalid int64 Unknown int64 Put int64 Get int64 GetAudit int64 GetRepair int64 PutRepair int64 Delete int64 }
Usage contains bandwidth usage information based on the type
func TotalMonthlySummary ¶ added in v0.10.0
TotalMonthlySummary returns total bandwidth usage for current month
Click to show internal directories.
Click to hide internal directories.