Documentation
¶
Index ¶
- func Deserialize(raw []byte, doc any) error
- func Serialize(doc *Document) ([]byte, error)
- func SerializeDocV1(doc *DocumentV1) ([]byte, error)
- type Address
- type BigPayloadWorkload
- type DDLWorkload
- type Document
- type DocumentV1
- type DropCreateWriteWorkload
- type IDocument
- type InsertOnlyWorkload
- type Nested
- type Queue
- type QueueDocuments
- type ReplaceOnlyWorkload
- type SearchOnlyWorkload
- type SmallConciseWorkload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
func SerializeDocV1 ¶
func SerializeDocV1(doc *DocumentV1) ([]byte, error)
Types ¶
type BigPayloadWorkload ¶
type BigPayloadWorkload struct {
Threads int16
Records int64
Database string
Collections string
Schemas []byte
WorkloadData *Queue
IsBatch bool
}
func (*BigPayloadWorkload) Check ¶
func (w *BigPayloadWorkload) Check(client driver.Driver) (bool, error)
func (*BigPayloadWorkload) Start ¶
func (w *BigPayloadWorkload) Start(client driver.Driver) (int64, error)
func (*BigPayloadWorkload) Type ¶
func (*BigPayloadWorkload) Type() string
type DDLWorkload ¶
func (*DDLWorkload) Type ¶
func (*DDLWorkload) Type() string
type Document ¶
type Document struct {
Id int64 `json:"id"`
F2 string `fake:"{sentence:50}" json:"F2"`
F3 []byte
F4 uuid.UUID
F5 time.Time
}
func NewDocument ¶
type DocumentV1 ¶
type DocumentV1 struct {
Id int64 `json:"id"`
Cars []string `fake:"{carmaker}" fakesize:"20000" json:"cars"`
Food []string `fake:"{food}" fakesize:"20000" json:"food"`
CreatedAt time.Time `fake:"{date}" json:"created_at"`
UpdatedAt time.Time `fake:"{date}" json:"updated_at"`
Nested *Nested `json:"nested"`
}
func NewDocumentV1 ¶
func NewDocumentV1(id int64) *DocumentV1
func (*DocumentV1) ID ¶
func (d *DocumentV1) ID() int64
type DropCreateWriteWorkload ¶
type DropCreateWriteWorkload struct {
Threads int16
Database string
Collections []string
Schemas [][]byte
Records int64
}
func (*DropCreateWriteWorkload) Check ¶
func (*DropCreateWriteWorkload) Check(_ driver.Driver) (bool, error)
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 (*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) Start ¶
func (w *InsertOnlyWorkload) Start(client driver.Driver) (int64, error)
func (*InsertOnlyWorkload) Type ¶
func (*InsertOnlyWorkload) Type() string
type Nested ¶
type Nested struct {
Timestamp int64 `fake:"{nanosecond}" json:"timestamp"`
Random string `fake:"{paragraph:10,10,50}" json:"random"`
Random1 string `fake:"{paragraph:10,10,50}" json:"random1"`
Random2 string `fake:"{paragraph:10,10,50}" json:"random2"`
Random3 string `fake:"{paragraph:10,10,50}" json:"random3"`
Random4 string `fake:"{paragraph:10,10,50}" json:"random4"`
Random5 string `fake:"{paragraph:10,10,50}" json:"random5"`
Random6 string `fake:"{paragraph:10,10,50}" json:"random6"`
Random7 string `fake:"{paragraph:10,10,50}" json:"random7"`
Random8 string `fake:"{paragraph:10,10,50}" json:"random8"`
Random9 string `fake:"{paragraph:10,10,50}" json:"random9"`
Random10 string `fake:"{paragraph:10,10,50}" json:"random10"`
Name string `fake:"{paragraph:10,10,50}" json:"name"`
URL string `fake:"{paragraph:10,10,50}" json:"url"`
Domain string `fake:"{sentence:50}" json:"domain"`
Sentence string `fake:"{paragraph:10,10,50}" json:"sentence"`
Company string `fake:"{paragraph:10,10,50}" json:"company"`
Labels []string `fakesize:"20000" json:"labels"`
Address Address `json:"address"`
NestedId string `fake:"{uuid}" json:"nested_id"`
}
type QueueDocuments ¶
func NewQueueDocuments ¶
func NewQueueDocuments(collection string) *QueueDocuments
func (*QueueDocuments) Add ¶
func (q *QueueDocuments) Add(doc IDocument)
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) Start ¶
func (w *ReplaceOnlyWorkload) Start(client driver.Driver) (int64, error)
func (*ReplaceOnlyWorkload) Type ¶
func (*ReplaceOnlyWorkload) Type() string
type SearchOnlyWorkload ¶
type SearchOnlyWorkload struct {
Threads int16
Records int64
Project string
Index string
Schema []byte
WorkloadData *Queue
}
func (*SearchOnlyWorkload) Check ¶
func (w *SearchOnlyWorkload) Check(client driver.Driver) (bool, error)
func (*SearchOnlyWorkload) Start ¶
func (w *SearchOnlyWorkload) Start(client driver.Driver) (int64, error)
func (*SearchOnlyWorkload) Type ¶
func (*SearchOnlyWorkload) Type() string
type SmallConciseWorkload ¶
type SmallConciseWorkload struct {
Threads int16
Records int64
Database string
Collections []string
Schemas [][]byte
WorkloadData *Queue
}
func (*SmallConciseWorkload) Check ¶
func (*SmallConciseWorkload) Check(_ driver.Driver) (bool, error)
func (*SmallConciseWorkload) Start ¶
func (w *SmallConciseWorkload) Start(client driver.Driver) (int64, error)
func (*SmallConciseWorkload) Type ¶
func (*SmallConciseWorkload) Type() string
Click to show internal directories.
Click to hide internal directories.