Documentation ¶
Overview ¶
Package index is a generated GoMock package.
Index ¶
- func ErrRunExists() error
- func ErrRunLoading() error
- type And
- type Count
- type False
- type HTTPReportLoader
- type Index
- type LessThan
- type Link
- type MetadataQuality
- type MockIndex
- func (m *MockIndex) Bind(arg0 []shared.TestRun, arg1 query.ConcreteQuery) (query.Plan, error)
- func (m *MockIndex) EXPECT() *MockIndexMockRecorder
- func (m *MockIndex) EvictRuns(arg0 float64) (int, error)
- func (m *MockIndex) IngestRun(arg0 shared.TestRun) error
- func (m *MockIndex) Run(arg0 RunID) (shared.TestRun, error)
- func (m *MockIndex) Runs(arg0 []RunID) ([]shared.TestRun, error)
- func (m *MockIndex) SetIngestChan(arg0 chan bool)
- type MockIndexMockRecorder
- func (mr *MockIndexMockRecorder) Bind(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockIndexMockRecorder) EvictRuns(arg0 interface{}) *gomock.Call
- func (mr *MockIndexMockRecorder) IngestRun(arg0 interface{}) *gomock.Call
- func (mr *MockIndexMockRecorder) Run(arg0 interface{}) *gomock.Call
- func (mr *MockIndexMockRecorder) Runs(arg0 interface{}) *gomock.Call
- func (mr *MockIndexMockRecorder) SetIngestChan(arg0 interface{}) *gomock.Call
- type MockReportLoader
- type MockReportLoaderMockRecorder
- type MoreThan
- type Not
- type Or
- type ProxyIndex
- type ReportLoader
- type ResultID
- type Results
- type RunID
- type RunResults
- type ShardedFilter
- type SubtestNamePattern
- type TestID
- type TestLabel
- type TestNamePattern
- type TestPath
- type TestWebFeature
- type Tests
- type Triaged
- type True
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.
type Count ¶
type Count struct {
// contains filtered or unexported fields
}
Count is a query.Count bound to an in-memory index.
type False ¶
type False struct {
// contains filtered or unexported fields
}
False is a query.False equivalent, bound to an in-memory index.
type HTTPReportLoader ¶
type HTTPReportLoader struct{}
HTTPReportLoader loads WPT test run reports from the URL specified in test run metadata.
func (HTTPReportLoader) Load ¶
func (l HTTPReportLoader) Load(run shared.TestRun) (*metrics.TestResultsReport, error)
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 Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is a query.Link bound to an in-memory index and MetadataResults.
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) EXPECT ¶
func (m *MockIndex) EXPECT() *MockIndexMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockIndex) SetIngestChan ¶
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 ¶
func (m *MockReportLoader) EXPECT() *MockReportLoaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockReportLoader) Load ¶
func (m *MockReportLoader) Load(arg0 shared.TestRun) (*metrics.TestResultsReport, error)
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 Not ¶
type Not struct {
// contains filtered or unexported fields
}
Not is a query.Not bound to an in-memory index.
type Or ¶
type Or struct {
// contains filtered or unexported fields
}
Or is a query.Or bound to an in-memory index.
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.
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.
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.