README

Go Reference

golang.org/x/build/internal/buildstats

Package buildstats contains code to sync the coordinator's build logs from Datastore to BigQuery.

Documentation

Overview

Package buildstats contains code to sync the coordinator's build logs from Datastore to BigQuery.

Index

Constants

This section is empty.

Variables

View Source
var Verbose = false

Verbose controls logging verbosity.

Functions

func SyncBuilds

func SyncBuilds(ctx context.Context, env *buildenv.Environment) error

SyncBuilds syncs the datastore "Build" entities to the BigQuery "Builds" table. This stores information on each build as a whole, without details.

func SyncSpans

func SyncSpans(ctx context.Context, env *buildenv.Environment) error

SyncSpans syncs the datastore "Span" entities to the BigQuery "Spans" table. These contain the fine-grained timing details of how a build ran.

Types

type BuilderTestStats

type BuilderTestStats struct {
	// Builder is which build configuration this is for.
	Builder string

	// Runs is how many times tests have run recently, for some
	// fuzzy definition of "recently".
	// The map key is a cmd/dist test name.
	Runs map[string]int

	// MedianDuration is the median duration for a test to
	// pass on this BuilderTestStat's Builder.
	// The map key is a cmd/dist test name.
	MedianDuration map[string]time.Duration
}

func (*BuilderTestStats) Tests

func (ts *BuilderTestStats) Tests() []string

type TestStats

type TestStats struct {
	// AsOf is the time that the stats were queried from BigQuery.
	AsOf time.Time

	// BuilderTestStats maps from a builder name to that builder's
	// test stats.
	BuilderTestStats map[string]*BuilderTestStats
}

TestStats describes stats for a cmd/dist test on a particular build configuration (a "builder").

func QueryTestStats

func QueryTestStats(ctx context.Context, env *buildenv.Environment) (*TestStats, error)

QueryTestStats returns stats on all tests for all builders.

func (*TestStats) Builders

func (ts *TestStats) Builders() []string

func (*TestStats) Duration

func (ts *TestStats) Duration(builder, testName string) time.Duration

Duration returns the median time to run testName on builder, if known. Otherwise it returns some non-zero default value.

Source Files