reporter

package
v0.0.0-...-5206ba3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRecord

type ActionRecord struct {
	ActionId        string       `bigquery:"action_id"`
	ActionDigest    string       `bigquery:"action_digest"`
	ActionSizeBytes int64        `bigquery:"action_size_bytes"`
	OutputFiles     []FileRecord `bigquery:"output_files"`

	WorkerCluster      string `bigquery:"worker_cluster"`
	WorkerVirtualNode  string `bigquery:"worker_virtual_node"`
	WorkerPhysicalNode string `bigquery:"worker_physical_node"`
	WorkerEnvironment  string `bigquery:"worker_environment"`
	WorkerPoolName     string `bigquery:"worker_pool_name"`
	WorkerPoolVersion  string `bigquery:"worker_pool_version"`
	WorkerThread       uint32 `bigquery:"worker_thread"`

	QueuedTime                 time.Time `bigquery:"queued_time"`
	WorkerStartTime            time.Time `bigquery:"worker_start_time"`
	WorkerCompletedTime        time.Time `bigquery:"worker_completed_time"`
	InputFetchStartTime        time.Time `bigquery:"input_fetch_start_time"`
	InputFetchCompletedTime    time.Time `bigquery:"input_fetch_completed_time"`
	ExecutionStartTime         time.Time `bigquery:"execution_start_time"`
	ExecutionCompletedTime     time.Time `bigquery:"execution_completed_time"`
	OutputUploadStartTime      time.Time `bigquery:"output_upload_start_time"`
	OutputUploadCompletedTime  time.Time `bigquery:"output_upload_completed_time"`
	VirtualExecutionDurationNs int64     `bigquery:"virtual_execution_duration_ns"`

	BazelVersion            string `bigquery:"bazel_version"`
	BazelInvocationId       string `bigquery:"bazel_invocation_id"`
	CorrelatedInvocationsId string `bigquery:"correlated_invocations_id"`
	Mnemonic                string `bigquery:"mnemonic"`
	Target                  string `bigquery:"target"`
	Configuration           string `bigquery:"configuration"`

	UserTimeNs                 int64 `bigquery:"user_time_ns"`
	SystemTimeNs               int64 `bigquery:"system_time_ns"`
	MaximumResidentSetSize     int64 `bigquery:"maximum_resident_set_size"`
	PageReclaims               int64 `bigquery:"page_reclaims"`
	PageFaults                 int64 `bigquery:"page_faults"`
	Swaps                      int64 `bigquery:"swaps"`
	BlockInputOperations       int64 `bigquery:"block_input_operations"`
	BlockOutputOperations      int64 `bigquery:"block_output_operations"`
	VoluntaryContextSwitches   int64 `bigquery:"voluntary_context_switches"`
	InvoluntaryContextSwitches int64 `bigquery:"involuntary_context_switches"`

	Expenses []Expense `bigquery:"expenses"`
}

func ActionRecordFromCompletedAction

func ActionRecordFromCompletedAction(c *cpb.CompletedAction) (*ActionRecord, error)

type BatchInserter

type BatchInserter[T any] interface {
	BatchInsert(context.Context, []*T) error
}

Inserter inserts multiple rows into a database.

func NewBigquery

func NewBigquery[T any](ctx context.Context, projectID string, dataset string, table string) (BatchInserter[T], error)

NewBigquery returns a BatchInserter that inserts into a specific table.

type BigqueryTable

type BigqueryTable[T any] struct {
	// contains filtered or unexported fields
}

BigqueryTable is an Inserter and BatchInserter that inserts into a specific BigQuery table.

func (*BigqueryTable[T]) BatchInsert

func (b *BigqueryTable[T]) BatchInsert(ctx context.Context, vals []*T) error

func (*BigqueryTable[T]) Insert

func (b *BigqueryTable[T]) Insert(ctx context.Context, val *T) error

type Expense

type Expense struct {
	Name      string  `bigquery:"name"`
	AmountUSD float64 `bigquery:"amount_usd"`
}

type FileRecord

type FileRecord struct {
	Filename  string `bigquery:"filename"`
	SizeBytes int64  `bigquery:"size_bytes"`
}

type Inserter

type Inserter[T any] interface {
	Insert(context.Context, *T) error
}

Inserter inserts a single row into a database.

type Service

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

func NewService

func NewService(
	ctx context.Context,
	storage BatchInserter[ActionRecord],
	batchSize int,
	batchTimeout time.Duration,
) (*Service, error)

func (*Service) LogCompletedActions

func (s *Service) LogCompletedActions(stream cpb.CompletedActionLogger_LogCompletedActionsServer) error

Jump to

Keyboard shortcuts

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