benchmark

package
v0.0.0-...-089ce19 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package benchmark provides interfaces related to rebuild benchmarks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBench

func RunBench(ctx context.Context, client *http.Client, apiURL *url.URL, set PackageSet, opts RunBenchOpts) (<-chan schema.Verdict, error)

Types

type BenchmarkMode

type BenchmarkMode string
const (
	SmoketestMode BenchmarkMode = "smoketest"
	AttestMode    BenchmarkMode = "attest"
)

type Metadata

type Metadata struct {
	Count   int
	Updated time.Time
}

Metadata describes characteristics of a PackageSet.

type Package

type Package struct {
	Ecosystem string
	Name      string
	Versions  []string
}

Package corresponds to one or more versions of a package to rebuild.

* Only the versions provided will be rebuilt. * All supported artifacts will be built for each provided version.

TODO: Possible extension of this form would include specific artifacts:

 {
   ...,
	  "artifacts": {"1.2.0": [...]},
 }

type PackageSet

type PackageSet struct {
	Metadata
	Packages []Package
}

PackageSet is a grouping of packages to evaluate rebuilds.

func ReadBenchmark

func ReadBenchmark(filename string) (ps PackageSet, err error)

func (*PackageSet) Hash

func (ps *PackageSet) Hash(h hash.Hash) []byte

Hash canonicalizes and returns a hash on its Packages using "h".

type RunBenchOpts

type RunBenchOpts struct {
	Mode BenchmarkMode
	// RunID is the ID for this run. Leave blank for one to be generated.
	RunID          string
	MaxConcurrency int
}

Directories

Path Synopsis
Package main generates rebuild benchmark files from external data sources.
Package main generates rebuild benchmark files from external data sources.

Jump to

Keyboard shortcuts

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