Documentation ¶
Index ¶
- Variables
- type Egress
- type Ingress
- type Monthly
- type Service
- func (service *Service) Monthly(ctx context.Context) (_ Monthly, err error)
- func (service *Service) MonthlyNode(ctx context.Context, nodeID storj.NodeID) (_ Monthly, err error)
- func (service *Service) MonthlySatellite(ctx context.Context, satelliteID storj.NodeID) (_ Monthly, err error)
- func (service *Service) MonthlySatelliteNode(ctx context.Context, satelliteID, nodeID storj.NodeID) (_ Monthly, err error)
- type UsageRollup
- type UsageRollupDailyCache
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is an error class for bandwidth service error. Error = errs.Class("bandwidth") )
Functions ¶
This section is empty.
Types ¶
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 Monthly ¶
type Monthly struct { BandwidthDaily []UsageRollup `json:"bandwidthDaily"` BandwidthSummary int64 `json:"bandwidthSummary"` EgressSummary int64 `json:"egressSummary"` IngressSummary int64 `json:"ingressSummary"` }
Monthly contains all bandwidth, ingress, egress monthly data.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes bandwidth related logic.
architecture: Service
func NewService ¶
NewService creates new instance of Service.
func (*Service) MonthlyNode ¶
func (service *Service) MonthlyNode(ctx context.Context, nodeID storj.NodeID) (_ Monthly, err error)
MonthlyNode returns monthly bandwidth summary for single node.
type UsageRollup ¶
type UsageRollup struct { Egress Egress `json:"egress"` Ingress Ingress `json:"ingress"` Delete int64 `json:"delete"` IntervalStart time.Time `json:"intervalStart"` }
UsageRollup contains rolluped bandwidth usage.
type UsageRollupDailyCache ¶
type UsageRollupDailyCache map[time.Time]UsageRollup
UsageRollupDailyCache caches storage usage stamps by interval date.
func (*UsageRollupDailyCache) Add ¶
func (cache *UsageRollupDailyCache) Add(rollup UsageRollup)
Add adds usage rollup to cache aggregating bandwidth data by date.
func (*UsageRollupDailyCache) Sorted ¶
func (cache *UsageRollupDailyCache) Sorted() []UsageRollup
Sorted returns usage rollup slice sorted by interval start.
Click to show internal directories.
Click to hide internal directories.