Documentation ¶
Index ¶
- Constants
- type CustomDuration
- type LoadTestComplex
- type LoadTestResults
- type LoadTestSimple
- type Payload
- type PostgresStorage
- func (p PostgresStorage) Delete(id int) error
- func (p PostgresStorage) Healthy() error
- func (p PostgresStorage) Init(query string) error
- func (p PostgresStorage) Insert(id string, itemName string, payload []byte) (int64, error)
- func (p PostgresStorage) Purge(table string) error
- func (p PostgresStorage) Select(itemId int) ([]byte, error)
- func (p PostgresStorage) SelectAll(count, start int) ([]byte, error)
- func (p PostgresStorage) Update(id int, payload Payload) error
- type Storage
Constants ¶
View Source
const CreateTableQuery string = `CREATE TABLE IF NOT EXISTS tests (
id uuid PRIMARY KEY,
name TEXT NOT NULL,
data jsonb);`
CreateTableQuery is sql query for creating fda_data table
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomDuration ¶
custom type for destructing string representation of time durations from json
func (*CustomDuration) MarshalJSON ¶
func (d *CustomDuration) MarshalJSON() ([]byte, error)
func (*CustomDuration) UnmarshalJSON ¶
func (d *CustomDuration) UnmarshalJSON(b []byte) (err error)
type LoadTestComplex ¶
type LoadTestComplex struct { Name string `json:"name"` Duration CustomDuration `json:"duration"` // in seconds TPS int `json:"tps"` Target string `json:"target"` }
type LoadTestResults ¶
type LoadTestResults struct { Latencies struct { Total int `json:"total"` Mean int `json:"mean"` Five0Th int `json:"50th"` Nine5Th int `json:"95th"` Nine9Th int `json:"99th"` Max int `json:"max"` } `json:"latencies"` BytesIn struct { Total int `json:"total"` Mean int `json:"mean"` } `json:"bytes_in"` BytesOut struct { Total int `json:"total"` Mean int `json:"mean"` } `json:"bytes_out"` Earliest time.Time `json:"earliest"` Latest time.Time `json:"latest"` End time.Time `json:"end"` Duration int `json:"duration"` Wait int `json:"wait"` Requests int `json:"requests"` Rate float64 `json:"rate"` Success int `json:"success"` StatusCodes struct { Num200 int `json:"200"` } `json:"status_codes"` Errors []interface{} `json:"errors"` }
type LoadTestSimple ¶
type LoadTestSimple struct { Name string `json:"name"` Method string `json:"method"` Url string `json:"url"` Duration CustomDuration `json:"duration"` // in seconds TPS int `json:"tps"` }
type Payload ¶
type Payload struct { ID string `json:"id"` Name string `json:"name"` Data json.RawMessage `json:"data"` // or could be []interface{} }
type PostgresStorage ¶
type PostgresStorage struct {
// contains filtered or unexported fields
}
func BootstrapPostgres ¶
func BootstrapPostgres(config *conf.DatabaseConfig) (PostgresStorage, error)
func (PostgresStorage) Delete ¶
func (p PostgresStorage) Delete(id int) error
func (PostgresStorage) Healthy ¶
func (p PostgresStorage) Healthy() error
func (PostgresStorage) Init ¶
func (p PostgresStorage) Init(query string) error
func (PostgresStorage) Purge ¶
func (p PostgresStorage) Purge(table string) error
Click to show internal directories.
Click to hide internal directories.