service

package
v1.7.16 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Package service manages the main logic of benchmark job.

Index

Constants

View Source
const (
	USERDEFINED jobType = iota
	INSERT
	SEARCH
	UPDATE
	UPSERT
	REMOVE
	GETOBJECT
	EXISTS
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job interface {
	PreStart(context.Context) error
	Start(context.Context) (<-chan error, error)
	Stop(context.Context) error
}

func New

func New(opts ...Option) (Job, error)

type Option

type Option func(j *job) error

func WithBeforeJobDuration

func WithBeforeJobDuration(dur string) Option

WithBeforeJobDuration sets the duration for watching beforeJobName's status.

func WithBeforeJobName

func WithBeforeJobName(bjn string) Option

WithBeforeJobName sets the beforeJobName which we should wait for until finish before running job.

func WithBeforeJobNamespace

func WithBeforeJobNamespace(bjns string) Option

WithBeforeJobNamespace sets the beforeJobNamespace of the beforeJobName which we should wait for until finish before running job.

func WithConcurencyLimit

func WithConcurencyLimit(limit int) Option

WithConcurencyLimit sets the goroutine limit for sending request to the target cluster.

func WithDataset

func WithDataset(d *config.BenchmarkDataset) Option

WithDataset sets the config.BenchmarkDataset including benchmark dataset name, group name of hdf5.Data, the number of index, start range and end range, and original URL which is used for download user defined hdf5.

func WithErrGroup

func WithErrGroup(eg errgroup.Group) Option

WithErrGroup sets the errgroup to the job struct to handle errors.

func WithHdf5

func WithHdf5(d hdf5.Data) Option

WithHdf5 sets the hdf5.Data which is used for benchmark job dataset.

func WithInsertConfig

func WithInsertConfig(c *config.InsertConfig) Option

WithInsertConfig sets the insert API config for running insert request job.

func WithJobFunc

func WithJobFunc(jf func(context.Context, chan error) error) Option

WithJobFunc sets the job function.

func WithJobType

func WithJobType(jt jobType) Option

WithJobType sets the jobType for running benchmark job.

func WithJobTypeByString

func WithJobTypeByString(t string) Option

WithJobTypeByString converts given string to JobType.

func WithK8sClient

func WithK8sClient(cli client.Client) Option

WithK8sClient binds the k8s client to the job struct which is used for get BenchmarkJobResource from Kubernetes API server.

func WithObjectConfig

func WithObjectConfig(c *config.ObjectConfig) Option

WithObjectConfig sets the get object API config for running get object request job.

func WithRPS

func WithRPS(rps int) Option

WithRPS sets the rpc for sending request per seconds to the target Vald cluster.

func WithRemoveConfig

func WithRemoveConfig(c *config.RemoveConfig) Option

WithRemoveConfig sets the remove API config for running remove request job.

func WithSearchConfig

func WithSearchConfig(c *config.SearchConfig) Option

WithSearchConfig sets the search API config for running search request job.

func WithUpdateConfig

func WithUpdateConfig(c *config.UpdateConfig) Option

WithUpdateConfig sets the update API config for running update request job.

func WithUpsertConfig

func WithUpsertConfig(c *config.UpsertConfig) Option

WithUpsertConfig sets the upsert API config for running upsert request job.

func WithValdClient

func WithValdClient(c vald.Client) Option

WithValdClient sets the Vald client for sending request to the target Vald cluster.

Jump to

Keyboard shortcuts

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