store_benchmarks

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRandomState

func CreateRandomState(store store.Store, count uint) ([]imap.InternalMessageID, error)

func NewStore

func NewStore(name, path string) (store.Store, error)

func NewStoreBenchmarkRunner

func NewStoreBenchmarkRunner(bench StoreBenchmark) benchmark.Benchmark

func RegisterStoreBuilder

func RegisterStoreBuilder(name string, storeBuilder StoreBuilder)

func RunStoreWorkersSplitRange

func RunStoreWorkersSplitRange(ctx context.Context, st store.Store, length uint, fn func(context.Context, store.Store, *timing.Collector, uint, uint) error) *reporter.BenchmarkRun

Types

type BadgerStoreBuilder

type BadgerStoreBuilder struct{}

func (*BadgerStoreBuilder) New

func (*BadgerStoreBuilder) New(path string) (store.Store, error)

type Create

type Create struct{}

func (*Create) Name

func (*Create) Name() string

func (*Create) Run

func (*Create) Setup

func (*Create) Setup(ctx context.Context, store store.Store) error

func (*Create) TearDown

func (*Create) TearDown(ctx context.Context, store store.Store) error

type DefaultStoreBuilder

type DefaultStoreBuilder struct{}

func (*DefaultStoreBuilder) New

func (*DefaultStoreBuilder) New(path string) (store.Store, error)

type Delete

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

func (*Delete) Name

func (*Delete) Name() string

func (*Delete) Run

func (*Delete) Setup

func (d *Delete) Setup(ctx context.Context, s store.Store) error

func (*Delete) TearDown

func (*Delete) TearDown(ctx context.Context, store store.Store) error

type Get

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

func (*Get) Name

func (*Get) Name() string

func (*Get) Run

func (g *Get) Run(ctx context.Context, st store.Store) (*reporter.BenchmarkRun, error)

func (*Get) Setup

func (g *Get) Setup(ctx context.Context, s store.Store) error

func (*Get) TearDown

func (*Get) TearDown(ctx context.Context, store store.Store) error

type StoreBenchmark

type StoreBenchmark interface {
	// Name returns benchmark's name.
	Name() string

	// Setup should prepare the benchmark.
	Setup(ctx context.Context, store store.Store) error

	// TearDown should clean the benchmark.
	TearDown(ctx context.Context, store store.Store) error

	// Run the benchmark.
	Run(ctx context.Context, store store.Store) (*reporter.BenchmarkRun, error)
}

type StoreBenchmarkRunner

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

func (*StoreBenchmarkRunner) Name

func (s *StoreBenchmarkRunner) Name() string

func (*StoreBenchmarkRunner) Run

func (*StoreBenchmarkRunner) Setup

func (s *StoreBenchmarkRunner) Setup(ctx context.Context, benchmarkDir string) error

func (*StoreBenchmarkRunner) TearDown

func (s *StoreBenchmarkRunner) TearDown(ctx context.Context) error

type StoreBuilder

type StoreBuilder interface {
	New(path string) (store.Store, error)
}

Jump to

Keyboard shortcuts

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