imap_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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToMailbox

func AppendToMailbox(cl *client.Client, mailboxName string, literal string, time time.Time, flags ...string) error

func BuildMailbox

func BuildMailbox(cl *client.Client, mailbox string, messageCount int) error

BuildMailbox creates a mailbox of name `mailbox` and fills it up with `messageCount` random messages.

func BuildMailboxWithMessages added in v0.12.0

func BuildMailboxWithMessages(cl *client.Client, mailbox string, messageCount int, messages []string) error

func FetchMessage

func FetchMessage(cl *client.Client, sequenceSet *imap.SeqSet, items ...imap.FetchItem) error

func FillMailbox

func FillMailbox(cl *client.Client, mbox string) error

func NewAppend

func NewAppend() benchmark.Benchmark

func NewCopy

func NewCopy() benchmark.Benchmark

func NewExpunge

func NewExpunge() benchmark.Benchmark

func NewFetch

func NewFetch() benchmark.Benchmark

func NewIMAPBenchmarkRun

func NewIMAPBenchmarkRun(duration time.Duration, cmdTimings [profiling.CmdTypeTotal][]time.Duration) *reporter.BenchmarkRun

func NewIMAPBenchmarkRunner

func NewIMAPBenchmarkRunner(bench IMAPBenchmark) benchmark.Benchmark

func NewMove

func NewMove() benchmark.Benchmark

func NewSearch

func NewSearch(query SearchQuery) benchmark.Benchmark

func NewSelect added in v0.12.0

func NewSelect() benchmark.Benchmark

func NewSelectFetch added in v0.17.0

func NewSelectFetch() benchmark.Benchmark

func NewSequenceSetAll

func NewSequenceSetAll() *imap.SeqSet

func NewStatus added in v0.12.0

func NewStatus() benchmark.Benchmark

func NewStore

func NewStore() benchmark.Benchmark

func RandomSequenceSetNum

func RandomSequenceSetNum(max uint32) *imap.SeqSet

func RandomSequenceSetRange

func RandomSequenceSetRange(max uint32) *imap.SeqSet

func RunParallelClients

func RunParallelClients(addr net.Addr, fn func(*client.Client, uint))

func RunParallelClientsWithMailbox

func RunParallelClientsWithMailbox(addr net.Addr, mbox string, readOnly bool, fn func(*client.Client, uint))

func RunParallelClientsWithMailboxes

func RunParallelClientsWithMailboxes(addr net.Addr, mailboxes []MailboxInfo, fn func(*client.Client, uint))

func SequenceListFromFile

func SequenceListFromFile(path string) ([]*imap.SeqSet, error)

func Store

func Store(cl *client.Client, sequenceSet *imap.SeqSet, item string, silent bool, flags ...string) error

func UIDFetchMessage

func UIDFetchMessage(cl *client.Client, sequenceSet *imap.SeqSet, items ...imap.FetchItem) error

func UIDStore

func UIDStore(cl *client.Client, sequenceSet *imap.SeqSet, item string, silent bool, flags ...string) error

func WithClient

func WithClient(addr net.Addr, fn func(*client.Client) error) error

Types

type Append

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

func (*Append) Name

func (a *Append) Name() string

func (*Append) Run

func (a *Append) Run(ctx context.Context, addr net.Addr) error

func (*Append) Setup

func (a *Append) Setup(ctx context.Context, addr net.Addr) error

func (*Append) TearDown

func (a *Append) TearDown(ctx context.Context, addr net.Addr) error

type Copy

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

func (*Copy) Name

func (*Copy) Name() string

func (*Copy) Run

func (c *Copy) Run(ctx context.Context, addr net.Addr) error

func (*Copy) Setup

func (c *Copy) Setup(ctx context.Context, addr net.Addr) error

func (*Copy) TearDown

func (c *Copy) TearDown(ctx context.Context, addr net.Addr) error

type Expunge

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

func (*Expunge) Name

func (*Expunge) Name() string

func (*Expunge) Run

func (e *Expunge) Run(ctx context.Context, addr net.Addr) error

func (*Expunge) Setup

func (e *Expunge) Setup(ctx context.Context, addr net.Addr) error

func (*Expunge) TearDown

func (e *Expunge) TearDown(ctx context.Context, addr net.Addr) error

type Fetch

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

func (*Fetch) Name

func (*Fetch) Name() string

func (*Fetch) Run

func (f *Fetch) Run(ctx context.Context, addr net.Addr) error

func (*Fetch) Setup

func (f *Fetch) Setup(ctx context.Context, addr net.Addr) error

func (*Fetch) TearDown

func (f *Fetch) TearDown(ctx context.Context, addr net.Addr) error

type IMAPBenchmark

type IMAPBenchmark interface {
	// Name should return the name of the benchmark. It will also be used to match against cli args.
	Name() string

	// Setup sets up the benchmark state, this is not timed.
	Setup(ctx context.Context, addr net.Addr) error

	// Run performs the actual benchmark, this is timed.
	Run(ctx context.Context, addr net.Addr) error

	// TearDown clear the benchmark state, this is not timed.
	TearDown(ctx context.Context, addr net.Addr) error
}

IMAPBenchmark is intended to be used to build benchmarks which bench IMAP commands on a given server.

type IMAPBenchmarkExtra

type IMAPBenchmarkExtra struct {
	CMDStatistic [profiling.CmdTypeTotal]*reporter.BenchmarkStatistics
}

func (*IMAPBenchmarkExtra) String

func (i *IMAPBenchmarkExtra) String() string

type IMAPBenchmarkRunner

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

func (*IMAPBenchmarkRunner) Name

func (i *IMAPBenchmarkRunner) Name() string

func (*IMAPBenchmarkRunner) Run

Run performs the actual benchmark, this is timed.

func (*IMAPBenchmarkRunner) Setup

func (i *IMAPBenchmarkRunner) Setup(ctx context.Context, benchmarkDir string) error

Setup sets up the benchmark state, this is not timed.

func (*IMAPBenchmarkRunner) TearDown

func (i *IMAPBenchmarkRunner) TearDown(ctx context.Context) error

TearDown clear the benchmark state, this is not timed.

type MailboxInfo

type MailboxInfo struct {
	Name     string
	ReadOnly bool
}

type Move

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

func (*Move) Name

func (*Move) Name() string

func (*Move) Run

func (m *Move) Run(ctx context.Context, addr net.Addr) error

func (*Move) Setup

func (m *Move) Setup(ctx context.Context, addr net.Addr) error

func (*Move) TearDown

func (m *Move) TearDown(ctx context.Context, addr net.Addr) error

type ParallelSeqSet

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

ParallelSeqSet contains a list of sequence sets which can be used by the benchmarks. Use one of the several new functions to initialize the state. Internally it holds one list per expected worker.

func NewParallelSeqSet

func NewParallelSeqSet(count uint32, numWorkers uint, listFile string, generateAll, generateIntervals, randomDrain, uid bool) (*ParallelSeqSet, error)

NewParallelSeqSet generates a parallel SeqSet based on the following conditions:

  • If a listFile is not empty, it will load the sequence sets from that file.
  • If generateAll is set to true, it will call NewParallelSeqSetAll.
  • If none of the above are valid it will generate random collection of sequence sets which can be single or intervals based on whether generateIntervals is set to true. If randomDrain is set to true, it will generate non repeating sequences. E.g. Useful for move or delete benchmarks. If uid is set to true, it will assume the values are UIDs rather than sequence IDs.

func NewParallelSeqSetAll

func NewParallelSeqSetAll(numWorkers uint) *ParallelSeqSet

NewParallelSeqSetAll generates once sequence set for each worker which covers everything (1:*).

func NewParallelSeqSetExpunge

func NewParallelSeqSetExpunge(count uint32, numWorkers uint, generateIntervals, uid bool) *ParallelSeqSet

NewParallelSeqSetExpunge generates sequence ids or intervals that can be used in cases where the data is expunged and/or moved from the original inbox. It also makes sure that concurrent workers can't overlap to avoid operations on messages that no longer exist.

func NewParallelSeqSetFromFile

func NewParallelSeqSetFromFile(path string, numWorkers uint) (*ParallelSeqSet, error)

NewParallelSeqSetFromFile load the sequence sets from a file. The same sequence set will be assigned to all workers.

func NewParallelSeqSetRandom

func NewParallelSeqSetRandom(count uint32, numWorkers uint, generateIntervals, randomDrain, uid bool) *ParallelSeqSet

NewParallelSeqSetRandom generates count random sequence set for each worker. If generateIntervals is set to true, it will generate intervals rather than a single number. If randomDrain is set to true it will generate unique values that eventually exhaust the problem space.

func (*ParallelSeqSet) Get

func (p *ParallelSeqSet) Get(i uint) []*imap.SeqSet
type Search struct {
	// contains filtered or unexported fields
}

func (*Search) Name

func (s *Search) Name() string

func (*Search) Run

func (s *Search) Run(ctx context.Context, addr net.Addr) error

func (*Search) Setup

func (s *Search) Setup(ctx context.Context, addr net.Addr) error

func (*Search) TearDown

func (s *Search) TearDown(ctx context.Context, addr net.Addr) error

type SearchCmdQuery added in v0.12.0

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

func (*SearchCmdQuery) Name added in v0.12.0

func (*SearchCmdQuery) Name() string

func (*SearchCmdQuery) Run added in v0.12.0

func (s *SearchCmdQuery) Run(ctx context.Context, cl *client.Client, workerIndex uint) error

func (*SearchCmdQuery) Setup added in v0.12.0

func (s *SearchCmdQuery) Setup(ctx context.Context, cl *client.Client, searchCount uint32) error

func (*SearchCmdQuery) TearDown added in v0.12.0

func (*SearchCmdQuery) TearDown(ctx context.Context, cl *client.Client) error

type SearchQuery

type SearchQuery interface {
	Name() string
	Setup(context.Context, *client.Client, uint32) error
	Run(context.Context, *client.Client, uint) error
	TearDown(context.Context, *client.Client) error
}

type SearchSinceQuery

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

func (*SearchSinceQuery) Name

func (*SearchSinceQuery) Name() string

func (*SearchSinceQuery) Run

func (s *SearchSinceQuery) Run(ctx context.Context, cl *client.Client, workerIndex uint) error

func (*SearchSinceQuery) Setup

func (s *SearchSinceQuery) Setup(ctx context.Context, cl *client.Client, searchCount uint32) error

func (*SearchSinceQuery) TearDown

func (*SearchSinceQuery) TearDown(ctx context.Context, cl *client.Client) error

type SearchTextQuery

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

func (*SearchTextQuery) Name

func (s *SearchTextQuery) Name() string

func (*SearchTextQuery) Run

func (s *SearchTextQuery) Run(ctx context.Context, cl *client.Client, workerIndex uint) error

func (*SearchTextQuery) Setup

func (s *SearchTextQuery) Setup(ctx context.Context, cl *client.Client, searchCount uint32) error

func (*SearchTextQuery) TearDown

func (s *SearchTextQuery) TearDown(ctx context.Context, cl *client.Client) error

type Select added in v0.12.0

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

func (*Select) Name added in v0.12.0

func (*Select) Name() string

func (*Select) Run added in v0.12.0

func (s *Select) Run(ctx context.Context, addr net.Addr) error

func (*Select) Setup added in v0.12.0

func (s *Select) Setup(ctx context.Context, addr net.Addr) error

func (*Select) TearDown added in v0.12.0

func (s *Select) TearDown(ctx context.Context, addr net.Addr) error

type SelectFetch added in v0.17.0

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

func (*SelectFetch) Name added in v0.17.0

func (*SelectFetch) Name() string

func (*SelectFetch) Run added in v0.17.0

func (e *SelectFetch) Run(ctx context.Context, addr net.Addr) error

func (*SelectFetch) Setup added in v0.17.0

func (e *SelectFetch) Setup(ctx context.Context, addr net.Addr) error

func (*SelectFetch) TearDown added in v0.17.0

func (e *SelectFetch) TearDown(ctx context.Context, addr net.Addr) error

type Status added in v0.12.0

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

func (*Status) Name added in v0.12.0

func (*Status) Name() string

func (*Status) Run added in v0.12.0

func (s *Status) Run(ctx context.Context, addr net.Addr) error

func (*Status) Setup added in v0.12.0

func (s *Status) Setup(ctx context.Context, addr net.Addr) error

func (*Status) TearDown added in v0.12.0

func (s *Status) TearDown(ctx context.Context, addr net.Addr) error

type StoreBench

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

func (*StoreBench) Name

func (*StoreBench) Name() string

func (*StoreBench) Run

func (s *StoreBench) Run(ctx context.Context, addr net.Addr) error

func (*StoreBench) Setup

func (s *StoreBench) Setup(ctx context.Context, addr net.Addr) error

func (*StoreBench) TearDown

func (s *StoreBench) TearDown(ctx context.Context, addr net.Addr) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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