reports

package
v1.74.0-rc Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAttributionCSV

func GenerateAttributionCSV(ctx context.Context, database string, start time.Time, end time.Time, userAgents []string, output io.Writer) error

GenerateAttributionCSV creates a report with.

func ParseRange added in v0.29.0

func ParseRange(startArg, endArg string) (time.Time, time.Time, error)

ParseRange parses report date range arguments. If the dates are malformed or if the start date does not come before the end date, an error is returned. The end date is exclusive.

Types

type AttributionTotals added in v1.54.1

type AttributionTotals map[AttributionTotalsIndex]Total

AttributionTotals is a map of attribution totals per user agent, project ID, and bucket name combination.

func ProcessAttributions added in v1.57.1

func ProcessAttributions(rows []*attribution.BucketUsage, userAgents []string, log *zap.Logger) AttributionTotals

ProcessAttributions sums all bucket attribution by the first entry in the user agent, project ID, and bucket name.

type AttributionTotalsIndex added in v1.57.1

type AttributionTotalsIndex struct {
	UserAgent  string
	ProjectID  string
	BucketName string
}

AttributionTotalsIndex is a key into AttributionTotals.

type Total added in v1.54.1

type Total struct {
	ByteHours    float64
	SegmentHours float64
	ObjectHours  float64
	BucketHours  float64
	BytesEgress  int64
}

Total is the total attributable usage for a user agent over a period of time.

Jump to

Keyboard shortcuts

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