pfsload

package
v2.7.0-nightly.20230717 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const LoadSpecification string = `` /* 1095-byte string literal not displayed */

Variables

View Source
var File_internal_pfsload_pfsload_proto protoreflect.FileDescriptor

Functions

func Commit

func Commit(pachClient *client.APIClient, taskService task.Service, branch *pfs.Branch, spec *CommitSpec, seed int64, stateID string) (string, error)

func Modification

func Modification(env *Env, commit *pfs.Commit, spec *ModificationSpec) error

func NewValidatorClient

func NewValidatorClient(client Client) *validatorClient

func PutFile

func PutFile(ctx context.Context, c Client, fileSource FileSource, count int) (string, error)

func Worker

func Worker(pachClient *client.APIClient, taskService task.Service) error

Types

type Client

type Client interface {
	WithCreateFileSetClient(ctx context.Context, cb func(client.ModifyFile) error) (*pfs.CreateFileSetResponse, error)
	AddFileSet(ctx context.Context, commit *pfs.Commit, ID string) error
	GlobFile(ctx context.Context, commit *pfs.Commit, pattern string, cb func(*pfs.FileInfo) error) error
	WaitCommitSet(id string, cb func(*pfs.CommitInfo) error) error
	Ctx() context.Context
}

Client is the standard interface for a load testing client. TODO: This should become the client.Client interface when we put the standard pach client behind an interface that takes a context as the first parameter for each method.

func NewPachClient

func NewPachClient(client *client.APIClient) Client

type CommitSpec

type CommitSpec struct {
	Count         int64               `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	Modifications []*ModificationSpec `protobuf:"bytes,2,rep,name=modifications,proto3" json:"modifications,omitempty"`
	FileSources   []*FileSourceSpec   `protobuf:"bytes,3,rep,name=file_sources,json=fileSources,proto3" json:"file_sources,omitempty"`
	Validator     *ValidatorSpec      `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"`
	// contains filtered or unexported fields
}

func (*CommitSpec) Descriptor deprecated

func (*CommitSpec) Descriptor() ([]byte, []int)

Deprecated: Use CommitSpec.ProtoReflect.Descriptor instead.

func (*CommitSpec) GetCount

func (x *CommitSpec) GetCount() int64

func (*CommitSpec) GetFileSources

func (x *CommitSpec) GetFileSources() []*FileSourceSpec

func (*CommitSpec) GetModifications

func (x *CommitSpec) GetModifications() []*ModificationSpec

func (*CommitSpec) GetValidator

func (x *CommitSpec) GetValidator() *ValidatorSpec

func (*CommitSpec) MarshalLogObject

func (x *CommitSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*CommitSpec) ProtoMessage

func (*CommitSpec) ProtoMessage()

func (*CommitSpec) ProtoReflect added in v2.7.0

func (x *CommitSpec) ProtoReflect() protoreflect.Message

func (*CommitSpec) Reset

func (x *CommitSpec) Reset()

func (*CommitSpec) String

func (x *CommitSpec) String() string

type Env

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

func NewEnv

func NewEnv(pachClient *client.APIClient, taskService task.Service, spec *CommitSpec, seed int64) (*Env, error)

func (*Env) AuthToken

func (e *Env) AuthToken() string

func (*Env) Client

func (e *Env) Client() Client

func (*Env) FileSource

func (e *Env) FileSource(name string) *FileSourceSpec

func (*Env) Seed

func (e *Env) Seed() int64

func (*Env) TaskDoer

func (e *Env) TaskDoer() task.Doer

func (*Env) Validator

func (e *Env) Validator() *Validator

type FileSource

type FileSource interface {
	Next() (*RandomFile, error)
}

func NewFileSource

func NewFileSource(spec *FileSourceSpec, random *rand.Rand) FileSource

type FileSourceSpec

type FileSourceSpec struct {
	Name   string                `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Random *RandomFileSourceSpec `protobuf:"bytes,2,opt,name=random,proto3" json:"random,omitempty"`
	// contains filtered or unexported fields
}

func (*FileSourceSpec) Descriptor deprecated

func (*FileSourceSpec) Descriptor() ([]byte, []int)

Deprecated: Use FileSourceSpec.ProtoReflect.Descriptor instead.

func (*FileSourceSpec) GetName

func (x *FileSourceSpec) GetName() string

func (*FileSourceSpec) GetRandom

func (x *FileSourceSpec) GetRandom() *RandomFileSourceSpec

func (*FileSourceSpec) MarshalLogObject

func (x *FileSourceSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*FileSourceSpec) ProtoMessage

func (*FileSourceSpec) ProtoMessage()

func (*FileSourceSpec) ProtoReflect added in v2.7.0

func (x *FileSourceSpec) ProtoReflect() protoreflect.Message

func (*FileSourceSpec) Reset

func (x *FileSourceSpec) Reset()

func (*FileSourceSpec) String

func (x *FileSourceSpec) String() string

type FrequencySpec

type FrequencySpec struct {
	Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	Prob  int64 `protobuf:"varint,2,opt,name=prob,proto3" json:"prob,omitempty"`
	// contains filtered or unexported fields
}

func (*FrequencySpec) Descriptor deprecated

func (*FrequencySpec) Descriptor() ([]byte, []int)

Deprecated: Use FrequencySpec.ProtoReflect.Descriptor instead.

func (*FrequencySpec) GetCount

func (x *FrequencySpec) GetCount() int64

func (*FrequencySpec) GetProb

func (x *FrequencySpec) GetProb() int64

func (*FrequencySpec) MarshalLogObject

func (x *FrequencySpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*FrequencySpec) ProtoMessage

func (*FrequencySpec) ProtoMessage()

func (*FrequencySpec) ProtoReflect added in v2.7.0

func (x *FrequencySpec) ProtoReflect() protoreflect.Message

func (*FrequencySpec) Reset

func (x *FrequencySpec) Reset()

func (*FrequencySpec) String

func (x *FrequencySpec) String() string

type ModificationSpec

type ModificationSpec struct {
	Count   int64        `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	PutFile *PutFileSpec `protobuf:"bytes,2,opt,name=put_file,json=putFile,proto3" json:"put_file,omitempty"`
	// contains filtered or unexported fields
}

func (*ModificationSpec) Descriptor deprecated

func (*ModificationSpec) Descriptor() ([]byte, []int)

Deprecated: Use ModificationSpec.ProtoReflect.Descriptor instead.

func (*ModificationSpec) GetCount

func (x *ModificationSpec) GetCount() int64

func (*ModificationSpec) GetPutFile

func (x *ModificationSpec) GetPutFile() *PutFileSpec

func (*ModificationSpec) MarshalLogObject

func (x *ModificationSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*ModificationSpec) ProtoMessage

func (*ModificationSpec) ProtoMessage()

func (*ModificationSpec) ProtoReflect added in v2.7.0

func (x *ModificationSpec) ProtoReflect() protoreflect.Message

func (*ModificationSpec) Reset

func (x *ModificationSpec) Reset()

func (*ModificationSpec) String

func (x *ModificationSpec) String() string

type PutFileSpec

type PutFileSpec struct {
	Count  int64  `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	// contains filtered or unexported fields
}

func (*PutFileSpec) Descriptor deprecated

func (*PutFileSpec) Descriptor() ([]byte, []int)

Deprecated: Use PutFileSpec.ProtoReflect.Descriptor instead.

func (*PutFileSpec) GetCount

func (x *PutFileSpec) GetCount() int64

func (*PutFileSpec) GetSource

func (x *PutFileSpec) GetSource() string

func (*PutFileSpec) MarshalLogObject

func (x *PutFileSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*PutFileSpec) ProtoMessage

func (*PutFileSpec) ProtoMessage()

func (*PutFileSpec) ProtoReflect added in v2.7.0

func (x *PutFileSpec) ProtoReflect() protoreflect.Message

func (*PutFileSpec) Reset

func (x *PutFileSpec) Reset()

func (*PutFileSpec) String

func (x *PutFileSpec) String() string

type PutFileTask

type PutFileTask struct {
	Count      int64           `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	FileSource *FileSourceSpec `protobuf:"bytes,2,opt,name=file_source,json=fileSource,proto3" json:"file_source,omitempty"`
	Seed       int64           `protobuf:"varint,3,opt,name=seed,proto3" json:"seed,omitempty"`
	AuthToken  string          `protobuf:"bytes,4,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
	// contains filtered or unexported fields
}

func (*PutFileTask) Descriptor deprecated

func (*PutFileTask) Descriptor() ([]byte, []int)

Deprecated: Use PutFileTask.ProtoReflect.Descriptor instead.

func (*PutFileTask) GetAuthToken

func (x *PutFileTask) GetAuthToken() string

func (*PutFileTask) GetCount

func (x *PutFileTask) GetCount() int64

func (*PutFileTask) GetFileSource

func (x *PutFileTask) GetFileSource() *FileSourceSpec

func (*PutFileTask) GetSeed

func (x *PutFileTask) GetSeed() int64

func (*PutFileTask) MarshalLogObject

func (x *PutFileTask) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*PutFileTask) ProtoMessage

func (*PutFileTask) ProtoMessage()

func (*PutFileTask) ProtoReflect added in v2.7.0

func (x *PutFileTask) ProtoReflect() protoreflect.Message

func (*PutFileTask) Reset

func (x *PutFileTask) Reset()

func (*PutFileTask) String

func (x *PutFileTask) String() string

type PutFileTaskResult

type PutFileTaskResult struct {
	FileSetId string `protobuf:"bytes,1,opt,name=file_set_id,json=fileSetId,proto3" json:"file_set_id,omitempty"`
	Hash      []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*PutFileTaskResult) Descriptor deprecated

func (*PutFileTaskResult) Descriptor() ([]byte, []int)

Deprecated: Use PutFileTaskResult.ProtoReflect.Descriptor instead.

func (*PutFileTaskResult) GetFileSetId

func (x *PutFileTaskResult) GetFileSetId() string

func (*PutFileTaskResult) GetHash

func (x *PutFileTaskResult) GetHash() []byte

func (*PutFileTaskResult) MarshalLogObject

func (x *PutFileTaskResult) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*PutFileTaskResult) ProtoMessage

func (*PutFileTaskResult) ProtoMessage()

func (*PutFileTaskResult) ProtoReflect added in v2.7.0

func (x *PutFileTaskResult) ProtoReflect() protoreflect.Message

func (*PutFileTaskResult) Reset

func (x *PutFileTaskResult) Reset()

func (*PutFileTaskResult) String

func (x *PutFileTaskResult) String() string

type RandomDirectorySpec

type RandomDirectorySpec struct {
	Depth *SizeSpec `protobuf:"bytes,1,opt,name=depth,proto3" json:"depth,omitempty"`
	Run   int64     `protobuf:"varint,2,opt,name=run,proto3" json:"run,omitempty"`
	// contains filtered or unexported fields
}

func (*RandomDirectorySpec) Descriptor deprecated

func (*RandomDirectorySpec) Descriptor() ([]byte, []int)

Deprecated: Use RandomDirectorySpec.ProtoReflect.Descriptor instead.

func (*RandomDirectorySpec) GetDepth

func (x *RandomDirectorySpec) GetDepth() *SizeSpec

func (*RandomDirectorySpec) GetRun

func (x *RandomDirectorySpec) GetRun() int64

func (*RandomDirectorySpec) MarshalLogObject

func (x *RandomDirectorySpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*RandomDirectorySpec) ProtoMessage

func (*RandomDirectorySpec) ProtoMessage()

func (*RandomDirectorySpec) ProtoReflect added in v2.7.0

func (x *RandomDirectorySpec) ProtoReflect() protoreflect.Message

func (*RandomDirectorySpec) Reset

func (x *RandomDirectorySpec) Reset()

func (*RandomDirectorySpec) String

func (x *RandomDirectorySpec) String() string

type RandomFile

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

func Files

func Files(fileSource FileSource, count int) ([]*RandomFile, error)

func NewRandomFile

func NewRandomFile(path string, r io.Reader) *RandomFile

func (*RandomFile) Path

func (f *RandomFile) Path() string

func (*RandomFile) Read

func (f *RandomFile) Read(data []byte) (int, error)

type RandomFileSourceSpec

type RandomFileSourceSpec struct {
	Directory     *RandomDirectorySpec `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"`
	Sizes         []*SizeSpec          `protobuf:"bytes,2,rep,name=sizes,proto3" json:"sizes,omitempty"`
	IncrementPath bool                 `protobuf:"varint,3,opt,name=increment_path,json=incrementPath,proto3" json:"increment_path,omitempty"`
	// contains filtered or unexported fields
}

func (*RandomFileSourceSpec) Descriptor deprecated

func (*RandomFileSourceSpec) Descriptor() ([]byte, []int)

Deprecated: Use RandomFileSourceSpec.ProtoReflect.Descriptor instead.

func (*RandomFileSourceSpec) GetDirectory

func (x *RandomFileSourceSpec) GetDirectory() *RandomDirectorySpec

func (*RandomFileSourceSpec) GetIncrementPath

func (x *RandomFileSourceSpec) GetIncrementPath() bool

func (*RandomFileSourceSpec) GetSizes

func (x *RandomFileSourceSpec) GetSizes() []*SizeSpec

func (*RandomFileSourceSpec) MarshalLogObject

func (x *RandomFileSourceSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*RandomFileSourceSpec) ProtoMessage

func (*RandomFileSourceSpec) ProtoMessage()

func (*RandomFileSourceSpec) ProtoReflect added in v2.7.0

func (x *RandomFileSourceSpec) ProtoReflect() protoreflect.Message

func (*RandomFileSourceSpec) Reset

func (x *RandomFileSourceSpec) Reset()

func (*RandomFileSourceSpec) String

func (x *RandomFileSourceSpec) String() string

type SizeSpec

type SizeSpec struct {
	MinSize int64 `protobuf:"varint,1,opt,name=min_size,json=min,proto3" json:"min_size,omitempty"`
	MaxSize int64 `protobuf:"varint,2,opt,name=max_size,json=max,proto3" json:"max_size,omitempty"`
	Prob    int64 `protobuf:"varint,3,opt,name=prob,proto3" json:"prob,omitempty"`
	// contains filtered or unexported fields
}

func FuzzSize

func FuzzSize(specs []*SizeSpec, random *rand.Rand) (*SizeSpec, error)

func (*SizeSpec) Descriptor deprecated

func (*SizeSpec) Descriptor() ([]byte, []int)

Deprecated: Use SizeSpec.ProtoReflect.Descriptor instead.

func (*SizeSpec) GetMaxSize

func (x *SizeSpec) GetMaxSize() int64

func (*SizeSpec) GetMinSize

func (x *SizeSpec) GetMinSize() int64

func (*SizeSpec) GetProb

func (x *SizeSpec) GetProb() int64

func (*SizeSpec) MarshalLogObject

func (x *SizeSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*SizeSpec) ProtoMessage

func (*SizeSpec) ProtoMessage()

func (*SizeSpec) ProtoReflect added in v2.7.0

func (x *SizeSpec) ProtoReflect() protoreflect.Message

func (*SizeSpec) Reset

func (x *SizeSpec) Reset()

func (*SizeSpec) String

func (x *SizeSpec) String() string

type State

type State struct {
	Commits []*State_Commit `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"`
	// contains filtered or unexported fields
}

func (*State) Descriptor deprecated

func (*State) Descriptor() ([]byte, []int)

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetCommits

func (x *State) GetCommits() []*State_Commit

func (*State) MarshalLogObject

func (x *State) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect added in v2.7.0

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type State_Commit

type State_Commit struct {
	Commit *pfs.Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
	Hash   []byte      `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*State_Commit) Descriptor deprecated

func (*State_Commit) Descriptor() ([]byte, []int)

Deprecated: Use State_Commit.ProtoReflect.Descriptor instead.

func (*State_Commit) GetCommit

func (x *State_Commit) GetCommit() *pfs.Commit

func (*State_Commit) GetHash

func (x *State_Commit) GetHash() []byte

func (*State_Commit) MarshalLogObject

func (x *State_Commit) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*State_Commit) ProtoMessage

func (*State_Commit) ProtoMessage()

func (*State_Commit) ProtoReflect added in v2.7.0

func (x *State_Commit) ProtoReflect() protoreflect.Message

func (*State_Commit) Reset

func (x *State_Commit) Reset()

func (*State_Commit) String

func (x *State_Commit) String() string

type Validator

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

func NewValidator

func NewValidator(spec *ValidatorSpec, random *rand.Rand) (*Validator, error)

func (*Validator) AddHash

func (v *Validator) AddHash(hash []byte)

func (*Validator) Hash

func (v *Validator) Hash() []byte

func (*Validator) SetHash

func (v *Validator) SetHash(hash []byte)

func (*Validator) Validate

func (v *Validator) Validate(client Client, commit *pfs.Commit) error

type ValidatorSpec

type ValidatorSpec struct {
	Frequency *FrequencySpec `protobuf:"bytes,1,opt,name=frequency,proto3" json:"frequency,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidatorSpec) Descriptor deprecated

func (*ValidatorSpec) Descriptor() ([]byte, []int)

Deprecated: Use ValidatorSpec.ProtoReflect.Descriptor instead.

func (*ValidatorSpec) GetFrequency

func (x *ValidatorSpec) GetFrequency() *FrequencySpec

func (*ValidatorSpec) MarshalLogObject

func (x *ValidatorSpec) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*ValidatorSpec) ProtoMessage

func (*ValidatorSpec) ProtoMessage()

func (*ValidatorSpec) ProtoReflect added in v2.7.0

func (x *ValidatorSpec) ProtoReflect() protoreflect.Message

func (*ValidatorSpec) Reset

func (x *ValidatorSpec) Reset()

func (*ValidatorSpec) String

func (x *ValidatorSpec) String() string

Jump to

Keyboard shortcuts

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