rundex

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: 19 Imported by: 0

Documentation

Overview

Package rundex provides access to metadata about runs and attempts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoQuery

func DoQuery[T any](ctx context.Context, q firestore.Query, fn func(*firestore.DocumentSnapshot) T, out chan<- T) <-chan error

DoQuery executes a query, transforming and sending each document to the output channel.

Types

type FetchRebuildOpts

type FetchRebuildOpts struct {
	Clean  bool
	Filter string
}

type FetchRebuildRequest

type FetchRebuildRequest struct {
	Bench     *benchmark.PackageSet
	Executors []string
	Runs      []string
	Opts      FetchRebuildOpts
}

FetchRebuildRequest describes which Rebuild results you would like to fetch from firestore.

type FetchRunsOpts

type FetchRunsOpts struct {
	BenchmarkHash string
}

FetchRunsOpts describes which Runs you would like to fetch from firestore.

type FirestoreClient

type FirestoreClient struct {
	Client *firestore.Client
}

FirestoreClient is a wrapper around the external firestore client.

func NewFirestore

func NewFirestore(ctx context.Context, project string) (*FirestoreClient, error)

NewFirestore creates a new FirestoreClient.

func (*FirestoreClient) FetchRebuilds

func (f *FirestoreClient) FetchRebuilds(ctx context.Context, req *FetchRebuildRequest) (map[string]Rebuild, error)

FetchRebuilds fetches the Rebuild objects out of firestore.

func (*FirestoreClient) FetchRuns

func (f *FirestoreClient) FetchRuns(ctx context.Context, opts FetchRunsOpts) ([]Run, error)

FetchRuns fetches Runs out of firestore.

type LocalClient

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

LocalClient reads rebuilds from the local filesystem.

func NewLocalClient

func NewLocalClient() *LocalClient

func (*LocalClient) FetchRebuilds

func (f *LocalClient) FetchRebuilds(ctx context.Context, req *FetchRebuildRequest) (map[string]Rebuild, error)

FetchRebuilds fetches the Rebuild objects out of firestore.

func (*LocalClient) FetchRuns

func (f *LocalClient) FetchRuns(ctx context.Context, opts FetchRunsOpts) ([]Run, error)

FetchRuns fetches Runs out of firestore.

func (*LocalClient) WriteRebuild

func (f *LocalClient) WriteRebuild(ctx context.Context, r Rebuild) error

func (*LocalClient) WriteRun

func (f *LocalClient) WriteRun(ctx context.Context, r Run) error

type Reader

type Reader interface {
	FetchRuns(context.Context, FetchRunsOpts) ([]Run, error)
	FetchRebuilds(context.Context, *FetchRebuildRequest) (map[string]Rebuild, error)
}

type Rebuild

type Rebuild struct {
	schema.SmoketestAttempt
	Created time.Time
}

Rebuild represents the result of a specific rebuild.

func NewRebuildFromFirestore

func NewRebuildFromFirestore(doc *firestore.DocumentSnapshot) Rebuild

NewRebuildFromFirestore creates a Rebuild instance from a "attempt" collection document.

func (*Rebuild) ID

func (r *Rebuild) ID() string

ID returns a stable, human-readable formatting of the ecosystem, package, and version.

func (Rebuild) Target

func (r Rebuild) Target() rebuild.Target

type Run

type Run struct {
	ID            string
	BenchmarkName string
	BenchmarkHash string
	Type          benchmark.BenchmarkMode
	Created       time.Time
}

Run represents a group of one or more rebuild executions.

func NewRunFromFirestore

func NewRunFromFirestore(doc *firestore.DocumentSnapshot) Run

NewRunFromFirestore creates a Run instance from a "runs" collection document.

type VerdictGroup

type VerdictGroup struct {
	Msg      string
	Count    int
	Examples []Rebuild
}

VerdictGroup is a collection of Rebuild objects, grouped by the same Message.

func GroupRebuilds

func GroupRebuilds(rebuilds map[string]Rebuild) (byCount []*VerdictGroup)

GroupRebuilds will create VerdictGroup objects, grouping rebuilds by Message.

type Writer

type Writer interface {
	WriteRebuild(ctx context.Context, r Rebuild) error
	WriteRun(ctx context.Context, r Run) error
}

Jump to

Keyboard shortcuts

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