internal

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorizer

func Authorizer() security.Authorizer

Authorizer implements an authorization policy that authorizes callers with any recognizeable blessing name.

func NewArchiver

func NewArchiver(store Store, url string) archive.BenchmarkArchiverServerStub

NewArchiver returns an archive.BenchmarkArchiver server that uses store to persist data and provides a UI to browse archived benchmark results at url.

func NewHTTPHandler

func NewHTTPHandler(assets *Assets, store Store) http.Handler

NewHTTPHandler returns a handler that provides web interface for browsing benchmark results in store.

Types

type Assets

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

func NewAssets

func NewAssets(dir string) (*Assets, error)

NewAssets returns an object that provides compiled-in assets if dir is empty or reads them from dir otherwise.

A non-empty dir is typically provided when iterating on the contents of the assets before release.

func (*Assets) File

func (a *Assets) File(name string) ([]byte, error)

func (*Assets) Template

func (a *Assets) Template(name string) (*template.Template, error)

type Benchmark

type Benchmark struct {
	ID       string       // A unique identifier of this particular Benchmark
	Name     string       // Name (e.g. v.io/v23/security.BenchmarkSign) of the Benchmark.
	Scenario ben.Scenario // The scenario under which the benchmark was run.
	Uploader string       // Identity of the user that uploaded the results.

	// Results from most recently uploaded runs for this benchmark.
	NanoSecsPerOp   float64
	MegaBytesPerSec float64
	LastUpdate      time.Time
}

Benchmark identifies a particular (Benchmark, Scenario, Uploader) tuple. Many ben.Run objects are associated with a single Benchmark.

func (Benchmark) PrettyTime

func (b Benchmark) PrettyTime() string

type BenchmarkIterator

type BenchmarkIterator interface {
	Iterator
	Value() Benchmark
	Runs() RunIterator
}

type Iterator

type Iterator interface {
	Advance() bool
	Err() error
	Close()
}

type Query

type Query struct {
	Name     string
	CPU      string
	OS       string
	Uploader string
	Label    string
}

func ParseQuery

func ParseQuery(query string) (*Query, error)

ParseQuery converts a query string into a structured Query object.

The query language supports setting each field in the Query object at most once and the query will be an AND of all terms. A more expressive query language is left as an excercise to a future enthusiast.

func (*Query) String

func (q *Query) String() string

type RunIterator

type RunIterator interface {
	Iterator
	Value() (run ben.Run, sourceCodeID string, uploadTime time.Time)
}

type Store

type Store interface {
	Save(ctx *context.T, scenario ben.Scenario, code ben.SourceCode, uploader string, uploadTime time.Time, runs []ben.Run) error
	Benchmarks(query *Query) BenchmarkIterator
	Runs(benchmarkID string) (Benchmark, RunIterator)
	DescribeSource(id string) (ben.SourceCode, error)
}

func NewSQLStore

func NewSQLStore(driver string, db *sql.DB) (Store, error)

NewSQLStore returns a Store implementation that uses the provided database for persistent storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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