build: golang.org/x/build/internal/buildstats Index | Files

package buildstats

import "golang.org/x/build/internal/buildstats"

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

Index

Package Files

buildstats.go

Variables

var Verbose = false

Verbose controls logging verbosity.

func SyncBuilds Uses

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 Uses

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.

type BuilderTestStats Uses

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 Uses

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

type TestStats Uses

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 Uses

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

QueryTestStats returns stats on all tests for all builders.

func (*TestStats) Builders Uses

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

func (*TestStats) Duration Uses

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.

Package buildstats imports 13 packages (graph) and is imported by 2 packages. Updated 2019-04-22. Refresh now. Tools for package owners.