workload

package
v1.0.0-beta.28 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serialize

func Serialize(doc *Document) ([]byte, error)

Types

type DDLWorkload

type DDLWorkload struct {
	Threads     int16
	Database    string
	Collections []string
	Schemas     [][]byte
}

func (*DDLWorkload) Check

func (w *DDLWorkload) Check(client driver.Driver) (bool, error)

func (*DDLWorkload) Setup

func (w *DDLWorkload) Setup(client driver.Driver) error

func (*DDLWorkload) Start

func (w *DDLWorkload) Start(client driver.Driver) (int64, error)

func (*DDLWorkload) Type

func (w *DDLWorkload) Type() string

type Document

type Document struct {
	F1 int64
	F2 string
	F3 []byte
	F4 uuid.UUID
	F5 time.Time
}

func Deserialize

func Deserialize(raw []byte) (*Document, error)

func NewDocument

func NewDocument(uniqueId int64) *Document

type DropCreateWriteWorkload

type DropCreateWriteWorkload struct {
	Threads     int16
	Database    string
	Collections []string
	Schemas     [][]byte
	Records     int64
}

func (*DropCreateWriteWorkload) Check

func (*DropCreateWriteWorkload) Setup

func (w *DropCreateWriteWorkload) Setup(client driver.Driver) error

func (*DropCreateWriteWorkload) Start

func (w *DropCreateWriteWorkload) Start(client driver.Driver) (int64, error)

func (*DropCreateWriteWorkload) Type

func (w *DropCreateWriteWorkload) Type() string

type InsertOnlyWorkload

type InsertOnlyWorkload struct {
	Threads      int16
	Records      int64
	Database     string
	Collections  []string
	Schemas      [][]byte
	WorkloadData *Queue
}

func (*InsertOnlyWorkload) Check

func (w *InsertOnlyWorkload) Check(client driver.Driver) (bool, error)

func (*InsertOnlyWorkload) Setup

func (w *InsertOnlyWorkload) Setup(client driver.Driver) error

func (*InsertOnlyWorkload) Start

func (w *InsertOnlyWorkload) Start(client driver.Driver) (int64, error)

func (*InsertOnlyWorkload) Type

func (w *InsertOnlyWorkload) Type() string

type Queue

type Queue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(collections []string) *Queue

func (*Queue) Add

func (q *Queue) Add(collectionName string, doc *Document)

func (*Queue) Get

func (q *Queue) Get(collectionName string) *QueueDocuments

type QueueDocuments

type QueueDocuments struct {
	sync.Mutex

	Collection string
	Documents  map[int64]*Document
}

func NewQueueDocuments

func NewQueueDocuments(collection string) *QueueDocuments

func (*QueueDocuments) Add

func (q *QueueDocuments) Add(doc *Document)

type ReplaceOnlyWorkload

type ReplaceOnlyWorkload struct {
	Threads      int16
	Records      int64
	Database     string
	Collections  []string
	Schemas      [][]byte
	WorkloadData *Queue
}

func (*ReplaceOnlyWorkload) Check

func (w *ReplaceOnlyWorkload) Check(client driver.Driver) (bool, error)

func (*ReplaceOnlyWorkload) Setup

func (w *ReplaceOnlyWorkload) Setup(client driver.Driver) error

func (*ReplaceOnlyWorkload) Start

func (w *ReplaceOnlyWorkload) Start(client driver.Driver) (int64, error)

func (*ReplaceOnlyWorkload) Type

func (w *ReplaceOnlyWorkload) Type() string

type SmallConciseWorkload

type SmallConciseWorkload struct {
	Threads      int16
	Records      int64
	Database     string
	Collections  []string
	Schemas      [][]byte
	WorkloadData *Queue
}

func (*SmallConciseWorkload) Check

func (w *SmallConciseWorkload) Check(client driver.Driver) (bool, error)

func (*SmallConciseWorkload) Setup

func (w *SmallConciseWorkload) Setup(client driver.Driver) error

func (*SmallConciseWorkload) Start

func (w *SmallConciseWorkload) Start(client driver.Driver) (int64, error)

func (*SmallConciseWorkload) Start1

func (w *SmallConciseWorkload) Start1(client driver.Driver) (int64, error)

func (*SmallConciseWorkload) Type

func (w *SmallConciseWorkload) Type() string

Jump to

Keyboard shortcuts

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