...

Package benchmark

import "go.mongodb.org/mongo-driver/benchmark"
Overview
Index

Overview ▾

Index ▾

Constants
func BSONDeepDocumentDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONDeepDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error
func BSONDeepDocumentEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONDeepMapDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONDeepMapEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatDocumentDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error
func BSONFlatDocumentEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatMapDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatMapEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatStructDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatStructEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatStructTagsDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFlatStructTagsEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFullDocumentDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFullDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error
func BSONFullDocumentEncoding(_ context.Context, tm TimerManager, iters int) error
func BSONFullMapDecoding(_ context.Context, tm TimerManager, iters int) error
func BSONFullMapEncoding(_ context.Context, tm TimerManager, iters int) error
func CanaryIncCase(context.Context, TimerManager, int) error
func DriverBenchmarkMain() int
func GlobalCanaryIncCase(context.Context, TimerManager, int) error
func MultiFindMany(ctx context.Context, tm TimerManager, iters int) error
func MultiInsertLargeDocument(ctx context.Context, tm TimerManager, iters int) error
func MultiInsertSmallDocument(ctx context.Context, tm TimerManager, iters int) error
func SingleFindOneByID(ctx context.Context, tm TimerManager, iters int) error
func SingleInsertLargeDocument(ctx context.Context, tm TimerManager, iters int) error
func SingleInsertSmallDocument(ctx context.Context, tm TimerManager, iters int) error
func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error
type BenchCase
type BenchFunction
    func WrapCase(bench BenchCase) BenchFunction
type BenchResult
    func (r *BenchResult) EvergreenPerfFormat() ([]interface{}, error)
    func (r *BenchResult) HasErrors() bool
    func (r *BenchResult) String() string
type CaseDefinition
    func (c *CaseDefinition) Name() string
    func (c *CaseDefinition) ResetTimer()
    func (c *CaseDefinition) Run(ctx context.Context) *BenchResult
    func (c *CaseDefinition) StartTimer()
    func (c *CaseDefinition) StopTimer()
    func (c *CaseDefinition) String() string
type Metric
type Result
type TimerManager

Package files

bson.go bson_document.go bson_map.go bson_struct.go bson_types.go canary.go harness.go harness_case.go harness_main.go harness_results.go multi.go single.go

Constants

const (
    ExecutionTimeout = five * time.Minute
    StandardRuntime  = time.Minute
    MinimumRuntime   = five * time.Second
    MinIterations    = hundred
)

func BSONDeepDocumentDecoding

func BSONDeepDocumentDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONDeepDocumentDecodingLazy

func BSONDeepDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error

func BSONDeepDocumentEncoding

func BSONDeepDocumentEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONDeepMapDecoding

func BSONDeepMapDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONDeepMapEncoding

func BSONDeepMapEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatDocumentDecoding

func BSONFlatDocumentDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatDocumentDecodingLazy

func BSONFlatDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error

func BSONFlatDocumentEncoding

func BSONFlatDocumentEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatMapDecoding

func BSONFlatMapDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatMapEncoding

func BSONFlatMapEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatStructDecoding

func BSONFlatStructDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatStructEncoding

func BSONFlatStructEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatStructTagsDecoding

func BSONFlatStructTagsDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFlatStructTagsEncoding

func BSONFlatStructTagsEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFullDocumentDecoding

func BSONFullDocumentDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFullDocumentDecodingLazy

func BSONFullDocumentDecodingLazy(_ context.Context, tm TimerManager, iters int) error

func BSONFullDocumentEncoding

func BSONFullDocumentEncoding(_ context.Context, tm TimerManager, iters int) error

func BSONFullMapDecoding

func BSONFullMapDecoding(_ context.Context, tm TimerManager, iters int) error

func BSONFullMapEncoding

func BSONFullMapEncoding(_ context.Context, tm TimerManager, iters int) error

func CanaryIncCase

func CanaryIncCase(context.Context, TimerManager, int) error

CanaryIncCase is a no-op.

Deprecated: CanaryIncCase has no observable effect, so recent versions of the Go compiler may bypass calls to it in the compiled binary. It should not be used in benchmarks.

func DriverBenchmarkMain

func DriverBenchmarkMain() int

func GlobalCanaryIncCase

func GlobalCanaryIncCase(context.Context, TimerManager, int) error

GlobalCanaryIncCase is a no-op.

Deprecated: GlobalCanaryIncCase has no observable effect, so recent versions of the Go compiler may bypass calls to it in the compiled binary. It should not be used in benchmarks.

func MultiFindMany

func MultiFindMany(ctx context.Context, tm TimerManager, iters int) error

func MultiInsertLargeDocument

func MultiInsertLargeDocument(ctx context.Context, tm TimerManager, iters int) error

func MultiInsertSmallDocument

func MultiInsertSmallDocument(ctx context.Context, tm TimerManager, iters int) error

func SingleFindOneByID

func SingleFindOneByID(ctx context.Context, tm TimerManager, iters int) error

func SingleInsertLargeDocument

func SingleInsertLargeDocument(ctx context.Context, tm TimerManager, iters int) error

func SingleInsertSmallDocument

func SingleInsertSmallDocument(ctx context.Context, tm TimerManager, iters int) error

func SingleRunCommand

func SingleRunCommand(ctx context.Context, tm TimerManager, iters int) error

type BenchCase

type BenchCase func(context.Context, TimerManager, int) error

type BenchFunction

type BenchFunction func(*testing.B)

func WrapCase

func WrapCase(bench BenchCase) BenchFunction

type BenchResult

type BenchResult struct {
    Name       string
    Trials     int
    Duration   time.Duration
    Raw        []Result
    DataSize   int
    Operations int
    // contains filtered or unexported fields
}

func (*BenchResult) EvergreenPerfFormat

func (r *BenchResult) EvergreenPerfFormat() ([]interface{}, error)

func (*BenchResult) HasErrors

func (r *BenchResult) HasErrors() bool

func (*BenchResult) String

func (r *BenchResult) String() string

type CaseDefinition

type CaseDefinition struct {
    Bench              BenchCase
    Count              int
    Size               int
    RequiredIterations int
    Runtime            time.Duration
    // contains filtered or unexported fields
}

func (*CaseDefinition) Name

func (c *CaseDefinition) Name() string

func (*CaseDefinition) ResetTimer

func (c *CaseDefinition) ResetTimer()

func (*CaseDefinition) Run

func (c *CaseDefinition) Run(ctx context.Context) *BenchResult

func (*CaseDefinition) StartTimer

func (c *CaseDefinition) StartTimer()

func (*CaseDefinition) StopTimer

func (c *CaseDefinition) StopTimer()

func (*CaseDefinition) String

func (c *CaseDefinition) String() string

type Metric

type Metric struct {
    Name  string      `json:"name"`
    Value interface{} `json:"value"`
}

type Result

type Result struct {
    Duration   time.Duration
    Iterations int
    Error      error
}

type TimerManager

TimerManager is a subset of the testing.B tool, used to manage setup code.

type TimerManager interface {
    ResetTimer()
    StartTimer()
    StopTimer()
}