index

package
v0.0.0-...-0cee358 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package index is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrRunExists

func ErrRunExists() error

ErrRunExists returns the error associated with an attempt to perform operations on a run currently unknown to an Index when the Index, in fact, already knows about the run.

func ErrRunLoading

func ErrRunLoading() error

ErrRunLoading returns the error associated with an attempt to perform operations on a run currently unknown to an Index when the Index, in fact, is currently loading data associated with the run.

Types

type And

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

And is a query.And bound to an in-memory index.

func (And) Filter

func (a And) Filter(t TestID) bool

Filter interprets an And as a filter function over TestIDs.

type Count

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

Count is a query.Count bound to an in-memory index.

func (Count) Filter

func (c Count) Filter(t TestID) bool

Filter interprets a Count as a filter function over TestIDs.

type False

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

False is a query.False equivalent, bound to an in-memory index.

func (False) Filter

func (False) Filter(_ TestID) bool

Filter always returns false for false.

type HTTPReportLoader

type HTTPReportLoader struct{}

HTTPReportLoader loads WPT test run reports from the URL specified in test run metadata.

func (HTTPReportLoader) Load

Load for HTTPReportLoader loads WPT test run reports from the URL specified in test run metadata.

type Index

type Index interface {
	query.Binder

	// Run loads the metadata associated with the given RunID value. It returns
	// an error if the Index does not understand the given RunID value.
	Run(RunID) (shared.TestRun, error)
	// Runs loads the metadata associated with the given RunID values. It returns
	// an error if the Index does not understand one or more of the given RunID
	// values.
	Runs([]RunID) ([]shared.TestRun, error)
	// IngestRun loads the test run results associated with the input test run
	// into the index.
	IngestRun(shared.TestRun) error
	// EvictRuns reduces memory pressure by evicting the cache's choice of runs
	// from memory. The parameter is a percentage of current runs to evict.
	EvictRuns(float64) (int, error)
	// SetIndexChan sets the channel that synchronizes before ingesting a run.
	// This channel is used by index monitors to ensure that the monitor is
	// scheduled to run frequently enough to keep pace with any influx of ingested
	// runs.
	SetIngestChan(chan bool)
}

Index is an index of test run results that can ingest and evict runs.

func NewShardedWPTIndex

func NewShardedWPTIndex(loader ReportLoader, numShards int) (Index, error)

NewShardedWPTIndex creates a new empty Index for WPT test run results. nolint:ireturn // TODO: Fix ireturn lint error

type LessThan

type LessThan Count

LessThan is a query.LessThan bound to an in-memory index.

func (LessThan) Filter

func (c LessThan) Filter(t TestID) bool

Filter interprets a LessThan as a filter function over TestIDs.

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

Link is a query.Link bound to an in-memory index and MetadataResults.

func (Link) Filter

func (l Link) Filter(t TestID) bool

Filter interprets a Link as a filter function over TestIDs.

type MetadataQuality

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

MetadataQuality is a query.MetadataQuality bound to an in-memory index.

func (MetadataQuality) Filter

func (q MetadataQuality) Filter(t TestID) bool

Filter interprets a MetadataQuality as a filter function over TestIDs.

type MockIndex

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

MockIndex is a mock of Index interface

func NewMockIndex

func NewMockIndex(ctrl *gomock.Controller) *MockIndex

NewMockIndex creates a new mock instance

func (*MockIndex) Bind

func (m *MockIndex) Bind(arg0 []shared.TestRun, arg1 query.ConcreteQuery) (query.Plan, error)

Bind mocks base method

func (*MockIndex) EXPECT

func (m *MockIndex) EXPECT() *MockIndexMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockIndex) EvictRuns

func (m *MockIndex) EvictRuns(arg0 float64) (int, error)

EvictRuns mocks base method

func (*MockIndex) IngestRun

func (m *MockIndex) IngestRun(arg0 shared.TestRun) error

IngestRun mocks base method

func (*MockIndex) Run

func (m *MockIndex) Run(arg0 RunID) (shared.TestRun, error)

Run mocks base method

func (*MockIndex) Runs

func (m *MockIndex) Runs(arg0 []RunID) ([]shared.TestRun, error)

Runs mocks base method

func (*MockIndex) SetIngestChan

func (m *MockIndex) SetIngestChan(arg0 chan bool)

SetIngestChan mocks base method

type MockIndexMockRecorder

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

MockIndexMockRecorder is the mock recorder for MockIndex

func (*MockIndexMockRecorder) Bind

func (mr *MockIndexMockRecorder) Bind(arg0, arg1 interface{}) *gomock.Call

Bind indicates an expected call of Bind

func (*MockIndexMockRecorder) EvictRuns

func (mr *MockIndexMockRecorder) EvictRuns(arg0 interface{}) *gomock.Call

EvictRuns indicates an expected call of EvictRuns

func (*MockIndexMockRecorder) IngestRun

func (mr *MockIndexMockRecorder) IngestRun(arg0 interface{}) *gomock.Call

IngestRun indicates an expected call of IngestRun

func (*MockIndexMockRecorder) Run

func (mr *MockIndexMockRecorder) Run(arg0 interface{}) *gomock.Call

Run indicates an expected call of Run

func (*MockIndexMockRecorder) Runs

func (mr *MockIndexMockRecorder) Runs(arg0 interface{}) *gomock.Call

Runs indicates an expected call of Runs

func (*MockIndexMockRecorder) SetIngestChan

func (mr *MockIndexMockRecorder) SetIngestChan(arg0 interface{}) *gomock.Call

SetIngestChan indicates an expected call of SetIngestChan

type MockReportLoader

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

MockReportLoader is a mock of ReportLoader interface

func NewMockReportLoader

func NewMockReportLoader(ctrl *gomock.Controller) *MockReportLoader

NewMockReportLoader creates a new mock instance

func (*MockReportLoader) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockReportLoader) Load

Load mocks base method

type MockReportLoaderMockRecorder

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

MockReportLoaderMockRecorder is the mock recorder for MockReportLoader

func (*MockReportLoaderMockRecorder) Load

func (mr *MockReportLoaderMockRecorder) Load(arg0 interface{}) *gomock.Call

Load indicates an expected call of Load

type MoreThan

type MoreThan Count

MoreThan is a query.MoreThan bound to an in-memory index.

func (MoreThan) Filter

func (c MoreThan) Filter(t TestID) bool

Filter interprets a MoreThan as a filter function over TestIDs.

type Not

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

Not is a query.Not bound to an in-memory index.

func (Not) Filter

func (n Not) Filter(t TestID) bool

Filter interprets a Not as a filter function over TestID.

type Or

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

Or is a query.Or bound to an in-memory index.

func (Or) Filter

func (o Or) Filter(t TestID) bool

Filter interprets an Or as a filter function over TestIDs.

type ProxyIndex

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

ProxyIndex is a proxy implementation of the Index interface. This type is generally used in type embeddings that wish to override the behaviour of some (but not all) methods, deferring to the delegate for all other behaviours.

func NewProxyIndex

func NewProxyIndex(idx Index) ProxyIndex

NewProxyIndex instantiates a new proxy index bound to the given delegate.

func (*ProxyIndex) EvictRuns

func (i *ProxyIndex) EvictRuns(percent float64) (int, error)

EvictRuns deletes percent% runs from the index by deferring to the proxy's delegate.

func (*ProxyIndex) IngestRun

func (i *ProxyIndex) IngestRun(r shared.TestRun) error

IngestRun loads the given run's results in to the index by deferring to the proxy's delegate.

func (*ProxyIndex) Run

func (i *ProxyIndex) Run(id RunID) (shared.TestRun, error)

Run loads the metadata for the given run ID value by deferring to the proxy's delegate.

func (*ProxyIndex) Runs

func (i *ProxyIndex) Runs(ids []RunID) ([]shared.TestRun, error)

Runs loads the metadata for the given run ID values by deferring to the proxy's delegate.

func (*ProxyIndex) SetIngestChan

func (i *ProxyIndex) SetIngestChan(c chan bool)

SetIngestChan sets the channel that synchronizes before ingesting a run by deferring to the proxy's delegate.

type ReportLoader

type ReportLoader interface {
	Load(shared.TestRun) (*metrics.TestResultsReport, error)
}

ReportLoader handles loading a WPT test results report based on metadata in a shared.TestRun.

func NewReportLoader

func NewReportLoader() ReportLoader

NewReportLoader constructs a loader that loads result reports over HTTP from a shared.TestRun.RawResultsURL. nolint:ireturn // TODO: Fix ireturn lint error

type ResultID

type ResultID int64

ResultID is a unique identifier for a WPT test result/status. RunID values are documented in github.com/web-platform-tests/wpt.fyi/shared TestStatus* values.

type Results

type Results interface {
	// Add stores a RunID => RunResults mapping.
	Add(RunID, RunResults) error
	// Delete deletes all result data for a particular WPT test run.
	Delete(RunID) error
	// ForRun produces a RunResults interface for a particular WPT test run, or
	// nil if the input RunID is unknown to this index.
	ForRun(RunID) RunResults
}

Results is an interface for an index that stores RunID => RunResults mappings.

func NewResults

func NewResults() Results

NewResults generates a new empty results index. nolint:ireturn // TODO: Fix ireturn lint error

type RunID

type RunID int64

RunID is a unique identifier for a WPT test run. These IDs are generated when a run is committed to Datastore.

type RunResults

type RunResults interface {
	// Add stores a TestID => ResultID mapping.
	Add(ResultID, TestID)
	// GetResult looks up the ResultID associated with a TestID; the
	// "status unknown" value is used if the lookup yields no ResultID.
	GetResult(TestID) ResultID
}

RunResults is an interface for an index that stores a TestID => ResultID mapping.

func NewRunResults

func NewRunResults() RunResults

NewRunResults generates a new empty run results index. nolint:ireturn // TODO: Fix ireturn lint error

type ShardedFilter

type ShardedFilter []filter

ShardedFilter is a collection of filters, each bound to a shard of in-memory index data.

func (ShardedFilter) Execute

func (fs ShardedFilter) Execute(runs []shared.TestRun, opts query.AggregationOpts) interface{}

Execute runs each filter in a ShardedFilter in parallel, returning a slice of TestIDs as the result. Note that TestIDs are not deduplicated; the assumption is that each filter is bound to a different shard, sharded by TestID.

type SubtestNamePattern

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

SubtestNamePattern is a query.SubtestNamePattern bound to an in-memory index.

func (SubtestNamePattern) Filter

func (tnp SubtestNamePattern) Filter(t TestID) bool

Filter interprets a SubtestNamePattern as a filter function over TestIDs.

type TestID

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

TestID is a unique identifier for a WPT test or sub-test.

type TestLabel

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

TestLabel is a query.TestLabel bound to an in-memory index and MetadataResults.

func (TestLabel) Filter

func (tl TestLabel) Filter(t TestID) bool

Filter interprets a TestLabel as a filter function over TestIDs.

type TestNamePattern

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

TestNamePattern is a query.TestNamePattern bound to an in-memory index.

func (TestNamePattern) Filter

func (tnp TestNamePattern) Filter(t TestID) bool

Filter interprets a TestNamePattern as a filter function over TestIDs.

type TestPath

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

TestPath is a query.TestPath bound to an in-memory index.

func (TestPath) Filter

func (tp TestPath) Filter(t TestID) bool

Filter interprets a TestPath as a filter function over TestIDs.

type TestWebFeature

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

TestWebFeature is a query.TestWebFeature bound to an in-memory index and WebFeaturesData.

func (TestWebFeature) Filter

func (twf TestWebFeature) Filter(t TestID) bool

Filter interprets a TestWebFeature as a filter function over TestIDs.

type Tests

type Tests interface {
	// Add adds a new named test/subtest to a tests index, using the given TestID
	// to identify the test/subtest in the index.
	Add(TestID, string, *string)
	// GetName retrieves the name/subtest name associated with a given TestID. If
	// the index does not recognize the TestID, then an error is returned.
	GetName(TestID) (string, *string, error)

	Range(func(TestID) bool)
}

Tests is an indexing component that provides fast test name lookup by TestID.

func NewTests

func NewTests() Tests

NewTests constructs an empty Tests instance. nolint:ireturn // TODO: Fix ireturn lint error

type Triaged

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

Triaged is a query.Triaged bound to an in-memory index and MetadataResults of a single browser.

func (Triaged) Filter

func (tr Triaged) Filter(t TestID) bool

Filter interprets a Triaged as a filter function over TestIDs.

type True

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

True is a query.True equivalent, bound to an in-memory index.

func (True) Filter

func (True) Filter(_ TestID) bool

Filter always returns true for true.

Jump to

Keyboard shortcuts

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