storetestcases

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package storetestcases defines test cases to test stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomFilterOffset

func RandomFilterOffset(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffset is a a FilterFunc that create a filter with a random offset.

func RandomFilterOffsetMapID

func RandomFilterOffsetMapID(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapID is a a FilterFunc that create a filter with a random offset and map ID. The map ID will be one of ten possible values.

func RandomFilterOffsetMapIDTags

func RandomFilterOffsetMapIDTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapIDTags is a a FilterFunc that create a filter with a random offset and map ID and tags. The map ID will be one of ten possible values. The tags will be one of fifty possible combinations.

func RandomFilterOffsetMapIDs

func RandomFilterOffsetMapIDs(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapIDs is a a FilterFunc that create a filter with a random offset and 2 map IDs. The map ID will be one of ten possible values.

func RandomFilterOffsetPrevLinkHash

func RandomFilterOffsetPrevLinkHash(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetPrevLinkHash is a a FilterFunc that create a filter with a random offset and previous link hash. The previous link hash will be one of ten possible values.

func RandomFilterOffsetPrevLinkHashTags

func RandomFilterOffsetPrevLinkHashTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetPrevLinkHashTags is a a FilterFunc that create a filter with a random offset and previous link hash and tags. The previous link hash will be one of ten possible values. The tags will be one of fifty possible combinations.

func RandomFilterOffsetTags

func RandomFilterOffsetTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetTags is a a FilterFunc that create a filter with a random offset and map ID. The tags will be one of fifty possible combinations.

func RandomLink(b *testing.B, numLinks, i int) *cs.Link

RandomLink is a CreateLinkFunc that creates a random segment.

func RandomLinkMapID added in v0.2.0

func RandomLinkMapID(b *testing.B, numLinks, i int) *cs.Link

RandomLinkMapID is a CreateLinkFunc that creates a random link with map ID. The map ID will be one of ten possible values.

func RandomLinkMapIDTags added in v0.2.0

func RandomLinkMapIDTags(b *testing.B, numLinks, i int) *cs.Link

RandomLinkMapIDTags is a CreateLinkFunc that creates a random link with map ID and tags. The map ID will be one of ten possible values. The tags will contain one of ten possible values.

func RandomLinkPrevLinkHash added in v0.2.0

func RandomLinkPrevLinkHash(b *testing.B, numLinks, i int) *cs.Link

RandomLinkPrevLinkHash is a CreateLinkFunc that creates a random link with previous link hash. The previous link hash will be one of ten possible values.

func RandomLinkPrevLinkHashTags added in v0.2.0

func RandomLinkPrevLinkHashTags(b *testing.B, numLinks, i int) *cs.Link

RandomLinkPrevLinkHashTags is a CreateLinkFunc that creates a random link with previous link hash and tags. The previous link hash will be one of ten possible values. The tags will contain one of ten possible values.

func RandomLinkTags added in v0.2.0

func RandomLinkTags(b *testing.B, numLinks, i int) *cs.Link

RandomLinkTags is a CreateLinkFunc that creates a random link with tags. The tags will contain one of ten possible values.

func RandomPaginationOffset

func RandomPaginationOffset(b *testing.B, numLinks, i int) *store.MapFilter

RandomPaginationOffset is a a PaginationFunc that create a pagination with a random offset.

Types

type CreateLinkFunc added in v0.2.0

type CreateLinkFunc func(b *testing.B, numLinks, i int) *cs.Link

CreateLinkFunc is a type for a function that creates a link for benchmarks.

type Factory

type Factory struct {
	// New creates an adapter.
	New func() (store.Adapter, error)

	// Free is an optional function to free an adapter.
	Free func(adapter store.Adapter)

	// NewKeyValueStore creates a KeyValueStore.
	// If your store implements the KeyValueStore interface,
	// you need to implement this method.
	NewKeyValueStore func() (store.KeyValueStore, error)

	// FreeKeyValueStore is an optional function to free
	// a KeyValueStore adapter.
	FreeKeyValueStore func(adapter store.KeyValueStore)
}

Factory wraps functions to allocate and free an adapter, and is used to run the tests on an adapter.

func (f Factory) BenchmarkCreateLink(b *testing.B)

BenchmarkCreateLink benchmarks creating new links.

func (Factory) BenchmarkCreateLinkParallel added in v0.2.0

func (f Factory) BenchmarkCreateLinkParallel(b *testing.B)

BenchmarkCreateLinkParallel benchmarks creating new links in parallel.

func (Factory) BenchmarkDeleteValue

func (f Factory) BenchmarkDeleteValue(b *testing.B)

BenchmarkDeleteValue benchmarks deleting existing segments.

func (Factory) BenchmarkDeleteValueParallel

func (f Factory) BenchmarkDeleteValueParallel(b *testing.B)

BenchmarkDeleteValueParallel benchmarks deleting existing segments in parallel.

func (Factory) BenchmarkFindSegments

func (f Factory) BenchmarkFindSegments(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc FilterFunc)

BenchmarkFindSegments benchmarks finding segments.

func (Factory) BenchmarkFindSegments100

func (f Factory) BenchmarkFindSegments100(b *testing.B)

BenchmarkFindSegments100 benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegments1000

func (f Factory) BenchmarkFindSegments1000(b *testing.B)

BenchmarkFindSegments1000 benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments10000

func (f Factory) BenchmarkFindSegments10000(b *testing.B)

BenchmarkFindSegments10000 benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments10000Parallel

func (f Factory) BenchmarkFindSegments10000Parallel(b *testing.B)

BenchmarkFindSegments10000Parallel benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments1000Parallel

func (f Factory) BenchmarkFindSegments1000Parallel(b *testing.B)

BenchmarkFindSegments1000Parallel benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments100Parallel

func (f Factory) BenchmarkFindSegments100Parallel(b *testing.B)

BenchmarkFindSegments100Parallel benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegmentsMapID100

func (f Factory) BenchmarkFindSegmentsMapID100(b *testing.B)

BenchmarkFindSegmentsMapID100 benchmarks finding segments with a map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsMapID1000

func (f Factory) BenchmarkFindSegmentsMapID1000(b *testing.B)

BenchmarkFindSegmentsMapID1000 benchmarks finding segments with a map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapID10000

func (f Factory) BenchmarkFindSegmentsMapID10000(b *testing.B)

BenchmarkFindSegmentsMapID10000 benchmarks finding segments with a map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapID10000Parallel

func (f Factory) BenchmarkFindSegmentsMapID10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapID10000Parallel benchmarks finding segments with a map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapID1000Parallel

func (f Factory) BenchmarkFindSegmentsMapID1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapID1000Parallel benchmarks finding segments with a map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapID100Parallel

func (f Factory) BenchmarkFindSegmentsMapID100Parallel(b *testing.B)

BenchmarkFindSegmentsMapID100Parallel benchmarks finding segments with a map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags100

func (f Factory) BenchmarkFindSegmentsMapIDTags100(b *testing.B)

BenchmarkFindSegmentsMapIDTags100 benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags1000

func (f Factory) BenchmarkFindSegmentsMapIDTags1000(b *testing.B)

BenchmarkFindSegmentsMapIDTags1000 benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags10000

func (f Factory) BenchmarkFindSegmentsMapIDTags10000(b *testing.B)

BenchmarkFindSegmentsMapIDTags10000 benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags10000Parallel

func (f Factory) BenchmarkFindSegmentsMapIDTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags10000Parallel benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags1000Parallel

func (f Factory) BenchmarkFindSegmentsMapIDTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags1000Parallel benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags100Parallel

func (f Factory) BenchmarkFindSegmentsMapIDTags100Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags100Parallel benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDs100

func (f Factory) BenchmarkFindSegmentsMapIDs100(b *testing.B)

BenchmarkFindSegmentsMapIDs100 benchmarks finding segments with several map IDs within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDs1000

func (f Factory) BenchmarkFindSegmentsMapIDs1000(b *testing.B)

BenchmarkFindSegmentsMapIDs1000 benchmarks finding segments with several map IDs within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs10000

func (f Factory) BenchmarkFindSegmentsMapIDs10000(b *testing.B)

BenchmarkFindSegmentsMapIDs10000 benchmarks finding segments with several map IDs within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs10000Parallel

func (f Factory) BenchmarkFindSegmentsMapIDs10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs10000Parallel benchmarks finding segments with several map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs1000Parallel

func (f Factory) BenchmarkFindSegmentsMapIDs1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs1000Parallel benchmarks finding segments with several map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs100Parallel

func (f Factory) BenchmarkFindSegmentsMapIDs100Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs100Parallel benchmarks finding segments with several map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsParallel

func (f Factory) BenchmarkFindSegmentsParallel(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc FilterFunc)

BenchmarkFindSegmentsParallel benchmarks finding segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash100

func (f Factory) BenchmarkFindSegmentsPrevLinkHash100(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash100 benchmarks finding segments with previous link hash within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000

func (f Factory) BenchmarkFindSegmentsPrevLinkHash1000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash1000 benchmarks finding segments with previous link hash within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000

func (f Factory) BenchmarkFindSegmentsPrevLinkHash10000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash10000 benchmarks finding segments with previous link hash within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHash10000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash10000Parallel benchmarks finding segments with a previous link hash within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHash1000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash1000Parallel benchmarks finding segments with a previous link hash within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash100Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHash100Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash100Parallel benchmarks finding segments with a previous link hash within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags100(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags100 benchmarks finding segments with previous link hash and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags1000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags1000 benchmarks finding segments with previous link hash and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags10000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags10000 benchmarks finding segments with previous link hash and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags10000Parallel benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags1000Parallel benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100Parallel

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags100Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags100Parallel benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsTags100

func (f Factory) BenchmarkFindSegmentsTags100(b *testing.B)

BenchmarkFindSegmentsTags100 benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkFindSegmentsTags1000

func (f Factory) BenchmarkFindSegmentsTags1000(b *testing.B)

BenchmarkFindSegmentsTags1000 benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags10000

func (f Factory) BenchmarkFindSegmentsTags10000(b *testing.B)

BenchmarkFindSegmentsTags10000 benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags10000Parallel

func (f Factory) BenchmarkFindSegmentsTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsTags10000Parallel benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags1000Parallel

func (f Factory) BenchmarkFindSegmentsTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsTags1000Parallel benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags100Parallel

func (f Factory) BenchmarkFindSegmentsTags100Parallel(b *testing.B)

BenchmarkFindSegmentsTags100Parallel benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkGetMapIDs

func (f Factory) BenchmarkGetMapIDs(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc MapFilterFunc)

BenchmarkGetMapIDs benchmarks getting map IDs.

func (Factory) BenchmarkGetMapIDs100

func (f Factory) BenchmarkGetMapIDs100(b *testing.B)

BenchmarkGetMapIDs100 benchmarks getting map IDs within 100 segments.

func (Factory) BenchmarkGetMapIDs1000

func (f Factory) BenchmarkGetMapIDs1000(b *testing.B)

BenchmarkGetMapIDs1000 benchmarks getting map IDs within 1000 segments.

func (Factory) BenchmarkGetMapIDs10000

func (f Factory) BenchmarkGetMapIDs10000(b *testing.B)

BenchmarkGetMapIDs10000 benchmarks getting map IDs within 10000 segments.

func (Factory) BenchmarkGetMapIDs10000Parallel

func (f Factory) BenchmarkGetMapIDs10000Parallel(b *testing.B)

BenchmarkGetMapIDs10000Parallel benchmarks getting map IDs within 10000 segments in parallel.

func (Factory) BenchmarkGetMapIDs1000Parallel

func (f Factory) BenchmarkGetMapIDs1000Parallel(b *testing.B)

BenchmarkGetMapIDs1000Parallel benchmarks getting map IDs within 1000 segments in parallel.

func (Factory) BenchmarkGetMapIDs100Parallel

func (f Factory) BenchmarkGetMapIDs100Parallel(b *testing.B)

BenchmarkGetMapIDs100Parallel benchmarks gettiBenchmarkFindSegmentsPrevLinkHashTags100Parallelng map IDs within 100 segments in parallel.

func (Factory) BenchmarkGetMapIDsParallel

func (f Factory) BenchmarkGetMapIDsParallel(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc MapFilterFunc)

BenchmarkGetMapIDsParallel benchmarks getting map IDs in parallel.

func (Factory) BenchmarkGetSegment

func (f Factory) BenchmarkGetSegment(b *testing.B)

BenchmarkGetSegment benchmarks getting existing segments.

func (Factory) BenchmarkGetSegmentParallel

func (f Factory) BenchmarkGetSegmentParallel(b *testing.B)

BenchmarkGetSegmentParallel benchmarks getting existing segments in parallel.

func (Factory) BenchmarkGetValue

func (f Factory) BenchmarkGetValue(b *testing.B)

BenchmarkGetValue benchmarks getting existing values.

func (Factory) BenchmarkGetValueParallel

func (f Factory) BenchmarkGetValueParallel(b *testing.B)

BenchmarkGetValueParallel benchmarks getting existing values in parallel.

func (Factory) BenchmarkSetValue added in v0.2.0

func (f Factory) BenchmarkSetValue(b *testing.B)

BenchmarkSetValue benchmarks saving new values.

func (Factory) BenchmarkSetValueParallel added in v0.2.0

func (f Factory) BenchmarkSetValueParallel(b *testing.B)

BenchmarkSetValueParallel benchmarks saving new values in parallel.

func (Factory) RunKeyValueStoreBenchmarks added in v0.2.0

func (f Factory) RunKeyValueStoreBenchmarks(b *testing.B)

RunKeyValueStoreBenchmarks runs all the benchmarks for the key-value store interface.

func (Factory) RunKeyValueStoreTests added in v0.2.0

func (f Factory) RunKeyValueStoreTests(t *testing.T)

RunKeyValueStoreTests runs all the tests for the key value store interface.

func (Factory) RunStoreBenchmarks added in v0.2.0

func (f Factory) RunStoreBenchmarks(b *testing.B)

RunStoreBenchmarks runs all the benchmarks for the store adapter interface.

func (Factory) RunStoreTests added in v0.2.0

func (f Factory) RunStoreTests(t *testing.T)

RunStoreTests runs all the tests for the store adapter interface.

func (Factory) TestBatch added in v0.2.0

func (f Factory) TestBatch(t *testing.T)

TestBatch runs all tests for the store.Batch interface

func (f Factory) TestCreateLink(t *testing.T)

TestCreateLink tests what happens when you create a new link.

func (Factory) TestEvidenceStore added in v0.2.0

func (f Factory) TestEvidenceStore(t *testing.T)

TestEvidenceStore runs all tests for the store.EvidenceStore interface

func (Factory) TestFindSegments

func (f Factory) TestFindSegments(t *testing.T)

TestFindSegments tests what happens when you search for segments with various filters.

func (Factory) TestGetInfo

func (f Factory) TestGetInfo(t *testing.T)

TestGetInfo tests what happens when you get information about the adapter.

func (Factory) TestGetMapIDs

func (f Factory) TestGetMapIDs(t *testing.T)

TestGetMapIDs tests what happens when you get map IDs.

func (Factory) TestGetSegment

func (f Factory) TestGetSegment(t *testing.T)

TestGetSegment tests what happens when you get a segment.

func (Factory) TestKeyValueStore added in v0.2.0

func (f Factory) TestKeyValueStore(t *testing.T)

TestKeyValueStore runs all tests for the store.KeyValueStore interface

func (Factory) TestStoreEvents added in v0.2.0

func (f Factory) TestStoreEvents(t *testing.T)

TestStoreEvents tests store channel event notifications.

type FilterFunc

type FilterFunc func(b *testing.B, numLinks, i int) *store.SegmentFilter

FilterFunc is a type for a function that creates a filter for benchmarks.

type MapFilterFunc

type MapFilterFunc func(b *testing.B, numLinks, i int) *store.MapFilter

MapFilterFunc is a type for a function that creates a mapId filter for benchmarks.

Jump to

Keyboard shortcuts

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