store_benchmarks

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRandomState

func CreateRandomState(st 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 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 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 OnDiskStoreBuilder added in v0.12.0

type OnDiskStoreBuilder struct{}

func (*OnDiskStoreBuilder) New added in v0.12.0

func (*OnDiskStoreBuilder) New(path string) (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