Documentation ¶
Overview ¶
Package bandwidth system keeps track of bandwidth usage as reported by order limits and orders.
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, now time.Time) (int64, error) Rollup(ctx context.Context) (err error) // Summary returns summary of bandwidth usages. Summary(ctx context.Context, from, to time.Time) (*Usage, error) // EgressSummary returns summary of egress bandwidth usages. EgressSummary(ctx context.Context, from, to time.Time) (*Usage, error) // IngressSummary returns summary of ingress bandwidth usages. IngressSummary(ctx context.Context, from, to time.Time) (*Usage, error) // SatelliteSummary returns aggregated bandwidth usage for a particular satellite. SatelliteSummary(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (*Usage, error) // SatelliteEgressSummary returns egress bandwidth usage for a particular satellite. SatelliteEgressSummary(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (*Usage, error) // SatelliteIngressSummary returns ingress bandwidth usage for a particular satellite. SatelliteIngressSummary(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (*Usage, error) SummaryBySatellite(ctx context.Context, from, to time.Time) (map[storj.NodeID]*Usage, error) // GetDailyRollups returns slice of daily bandwidth usage rollups for provided time range, // sorted in ascending order. GetDailyRollups(ctx context.Context, from, to time.Time) ([]UsageRollup, error) // GetDailySatelliteRollups returns slice of daily bandwidth usage for provided time range, // sorted in ascending order for a particular satellite. GetDailySatelliteRollups(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) ([]UsageRollup, error) }
DB contains information about bandwidth usage.
architecture: Database
type Egress ¶ added in v0.21.0
type Egress struct { Repair int64 `json:"repair"` Audit int64 `json:"audit"` Usage int64 `json:"usage"` }
Egress stores info about storage node egress usage.
type Service ¶ added in v0.16.0
Service implements the bandwidth usage rollup service.
architecture: Chore
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.