bench

package
v0.0.0-...-89949a1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Durations

type Durations struct {
	Min     time.Duration
	Max     time.Duration
	Average time.Duration
	Median  time.Duration
	Overall time.Duration
	// contains filtered or unexported fields
}

func (*Durations) String

func (ds *Durations) String() string

type Option

type Option func(o *options)

func NumWorkers

func NumWorkers(n int) Option

type Statements

type Statements struct {
	Total     int
	Succeeded int
	Failed    int
}

func (*Statements) String

func (s *Statements) String() string

type Stats

type Stats struct {
	Durations  Durations
	Statements Statements
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

func Run

func Run(ctx context.Context, input io.Reader, runner TaskRunner, opts ...Option) (*Stats, error)

func (*Stats) AddResult

func (s *Stats) AddResult(res TaskResult)

func (*Stats) End

func (s *Stats) End()

func (*Stats) String

func (s *Stats) String() string

type Task

type Task = string

type TaskResult

type TaskResult struct {
	Error    error
	Duration time.Duration
}

type TaskRunner

type TaskRunner func(ctx context.Context, task Task) TaskResult

func NewTaskRunner

func NewTaskRunner(pool *pgxpool.Pool) TaskRunner

Jump to

Keyboard shortcuts

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