Documentation ¶
Overview ¶
Package bigquery defines a BigQuery schema for benchmarks.
This package contains a schema for BigQuery and methods for publishing benchmark data into tables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBigQuery ¶
func InitBigQuery(ctx context.Context, projectID, datasetID, tableID string, opts []option.ClientOption) error
InitBigQuery initializes a BigQuery dataset/table in the project. If the dataset/table already exists, it is not duplicated.
func SendBenchmarks ¶
func SendBenchmarks(ctx context.Context, suite *Suite, projectID, datasetID, tableID string, opts []option.ClientOption) error
SendBenchmarks sends the slice of benchmarks to the BigQuery dataset/table.
Types ¶
type Benchmark ¶
type Benchmark struct { Name string `bq:"name"` Condition []*Condition `bq:"cond"` Metric []*Metric `bq:"metric"` }
Benchmark represents an individual benchmark in a suite.
func NewBenchmark ¶
NewBenchmark initializes a new benchmark.
func NewBenchmarkWithMetric ¶
NewBenchmarkWithMetric creates a new sending to BigQuery, initialized with a single iteration and single metric.
func (*Benchmark) AddCondition ¶
AddCondition adds a condition to an existing Benchmark.
type Condition ¶
Condition represents qualifiers for the benchmark or suite. For example: Get_Pid/1/real_time would have Benchmark Name "Get_Pid" with "1" and "real_time" parameters as conditions. Suite conditions include information such as the CL number and platform name.
func NewCondition ¶
NewCondition returns a new Condition with the given name and value.
type Suite ¶
type Suite struct { Name string `bq:"name"` Conditions []*Condition `bq:"conditions"` Benchmarks []*Benchmark `bq:"benchmarks"` Official bool `bq:"official"` Timestamp time.Time `bq:"timestamp"` }
Suite is the top level structure for a benchmark run. BigQuery will infer the schema from this.
func (*Suite) Benchstat ¶
Benchstat returns a benchstat-formatted output string. See https://pkg.go.dev/golang.org/x/perf/cmd/benchstat `includeConditions` contains names of `Condition`s that should be included as part of the benchmark name.