eventlog

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatasetID is name of BQ dataset.
	DatasetID = "qs_events"
	// TableID is name of BQ table.
	TableID = "task_events"
)

Variables

This section is empty.

Functions

func TaskEvents

func TaskEvents(ctx context.Context, events ...*metrics.TaskEvent) error

TaskEvents logs the given TaskEvents to a bigquery table asynchronously.

func Use

Use installs inserter into c.

Types

type AsyncBqInserter

type AsyncBqInserter interface {
	Insert(ctx context.Context, rows ...bigquery.ValueSaver) error
}

AsyncBqInserter defines what eventlog package expects from BQ inserting library.

type NullBQInserter

type NullBQInserter struct {
}

NullBQInserter implements AsyncBqInserter and just logs "inserted" events.

func (*NullBQInserter) Insert

func (n *NullBQInserter) Insert(ctx context.Context, rows ...bigquery.ValueSaver) error

Insert implements AsyncBqInserter interface.

type RAMBufferedBQInserter

type RAMBufferedBQInserter struct {
	ProjectID string
	DatasetID string
	TableID   string
	// contains filtered or unexported fields
}

RAMBufferedBQInserter implements AsyncBqInserter via in-RAM buffering of events for later sending to BQ.

func NewRAMBufferedBQInserter

func NewRAMBufferedBQInserter(ctx context.Context, projectID, datasetID, tableID string) (r *RAMBufferedBQInserter, err error)

NewRAMBufferedBQInserter instantiates new RAMBufferedBQInserter.

func (*RAMBufferedBQInserter) CloseAndDrain

func (r *RAMBufferedBQInserter) CloseAndDrain(ctx context.Context)

CloseAndDrain stops accepting new rows and waits until all buffered rows are sent or provided `ctx` times out.

func (*RAMBufferedBQInserter) Insert

Insert implements AsyncBqInserter interface.

Jump to

Keyboard shortcuts

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