etl

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrForbidden = errors.New("forbidden")
)

Functions

This section is empty.

Types

type Etl

type Etl struct {
	// contains filtered or unexported fields
}

Etl loads CDN usage data from files from GS bucket, aggregates them by hour and sends to Livepeer API to be put into database

func NewEtl

func NewEtl(ctx context.Context, cfg *config.Config, bucket, credentials string, staging bool,
	livepeerAPIKey string, livepeerAPIUrl *url.URL) (*Etl, error)

func (*Etl) Do

func (etl *Etl) Do() error

type SendData

type SendData struct {
	Date     int64            `json:"date"` // hour in Unix epoch
	Region   string           `json:"region"`
	FileName string           `json:"file_name"`
	Data     []*VideoStatsExt `json:"data"`
}

type VideoStat

type VideoStat struct {
	IP       string
	Filesize int64
	CsBytes  int64
	ScBytes  int64
	// contains filtered or unexported fields
}

type VideoStats

type VideoStats struct {
	IPs           []string `json:"i_ps,omitempty"`
	TotalFilesize int64    `json:"total_filesize,omitempty"`
	TotalCsBytes  int64    `json:"total_cs_bytes,omitempty"`
	TotalScBytes  int64    `json:"total_sc_bytes,omitempty"`
	Count         int      `json:"count,omitempty"`
}

type VideoStatsExt

type VideoStatsExt struct {
	StreamID      string `json:"stream_id"`
	PlaybackID    string `json:"playback_id"`
	UniqueUsers   int    `json:"unique_client_ips"`
	TotalFilesize int64  `json:"total_filesize"`
	TotalCsBytes  int64  `json:"total_cs_bytes"`
	TotalScBytes  int64  `json:"total_sc_bytes"`
	Count         int    `json:"count"`
}

Jump to

Keyboard shortcuts

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