Documentation ¶
Index ¶
- func ByteFormat(bytes float64) string
- func GenerateRandomString(seed int) string
- func Mapf(vs []Record, f func(Record) float64) []float64
- func ToCsv(report Report) ([]byte, error)
- func ToJson(ctx *BenchmarkContext) ([]byte, error)
- type BenchmarkContext
- type BenchmarkMode
- type BenchmarkOperation
- type BurstBenchmarkMode
- func (m *BurstBenchmarkMode) CleanupTestdata(ctx *BenchmarkContext, payloadSize uint64)
- func (m *BurstBenchmarkMode) DisableKeepAlives() bool
- func (m *BurstBenchmarkMode) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64)
- func (m *BurstBenchmarkMode) ExecuteBenchmark(ctx *BenchmarkContext, payloadSize uint64)
- func (m *BurstBenchmarkMode) IsFinished(numberOfRuns int) bool
- func (m *BurstBenchmarkMode) PrintFooter()
- func (m *BurstBenchmarkMode) PrintHeader(operationToTest string)
- func (m *BurstBenchmarkMode) PrintPayloadFooter()
- func (m *BurstBenchmarkMode) PrintPayloadHeader(objectSize uint64, operationToTest string)
- func (m *BurstBenchmarkMode) PrintRecord(record Record)
- type ByDNSLookup
- type ByFirstByte
- type ByLastByte
- type ByServerProcessing
- type ByTCPConnection
- type ByTLSHandshake
- type ByThroughputBps
- type ByUnassigned
- type FsObjectClient
- func (c *FsObjectClient) CreateBucket(bucketName string) (Latency, error)
- func (c *FsObjectClient) DeleteObject(bucketName string, key string) (Latency, error)
- func (c *FsObjectClient) GetObject(bucketName string, key string) (Latency, io.ReadCloser, error)
- func (c *FsObjectClient) HeadObject(bucketName string, key string) (Latency, error)
- func (c *FsObjectClient) PutObject(bucketName string, key string, reader *bytes.Reader) (Latency, error)
- type FsObjectClientConfig
- type Latency
- type LatencyBenchmarkMode
- func (m *LatencyBenchmarkMode) CleanupTestdata(ctx *BenchmarkContext, payloadSize uint64)
- func (m *LatencyBenchmarkMode) DisableKeepAlives() bool
- func (m *LatencyBenchmarkMode) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64)
- func (m *LatencyBenchmarkMode) ExecuteBenchmark(ctx *BenchmarkContext, payloadSize uint64)
- func (m *LatencyBenchmarkMode) IsFinished(numberOfRuns int) bool
- func (m *LatencyBenchmarkMode) PrintFooter()
- func (m *LatencyBenchmarkMode) PrintHeader(operationToTest string)
- func (m *LatencyBenchmarkMode) PrintPayloadFooter()
- func (m *LatencyBenchmarkMode) PrintPayloadHeader(objectSize uint64, operationToTest string)
- func (m *LatencyBenchmarkMode) PrintRecord(record Record)
- type NilTicker
- type OperationRead
- type OperationWrite
- type Record
- type Report
- type S3ObjectClient
- func (c *S3ObjectClient) CreateBucket(bucketName string) (Latency, error)
- func (c *S3ObjectClient) DeleteObject(bucketName string, key string) (Latency, error)
- func (c *S3ObjectClient) GetObject(bucketName string, key string) (Latency, io.ReadCloser, error)
- func (c *S3ObjectClient) HeadObject(bucketName string, key string) (Latency, error)
- func (c *S3ObjectClient) PutObject(bucketName string, key string, reader *bytes.Reader) (Latency, error)
- type S3ObjectClientConfig
- type StorageInterface
- type Ticker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomString ¶
func ToJson ¶
func ToJson(ctx *BenchmarkContext) ([]byte, error)
Types ¶
type BenchmarkContext ¶
type BenchmarkContext struct { Description string `json:"description"` // An optional description that helps to identify the test run. Hostname string `json:"hostname"` // the hostname where this benchmark is executed from Region string `json:"region"` // S3 region Endpoint string `json:"endpoint"` // the endpoint URL or path where the operations are directed to Path string `json:"path"` // the path where to operations are executed on PayloadsMin int `json:"payloads_min"` // the minimum payload to test (powers of 2) PayloadsMax int `json:"payloads_max"` // the maximum payload to test (powers of 2) ThreadsMin int `json:"threads_min"` // the mininum number of threads to test ThreadsMax int `json:"threads_max"` // the maxiumu number of threads to test Samples int `json:"samples"` // the number of samples to collect for each benchmark record OperationName string `json:"operation"` // operations might be "read" or "write. Default is "read". ModeName string `json:"mode"` // latency, throughput, ... Report Report `json:"report"` // The final report of this benchmark run // the BenchmarkMode instance of the testrun (corresponds to the ModeName) Mode BenchmarkMode `json:"-"` // The BenchmarkOperation instance of this testrun (corresponds to the OperationName) Operation BenchmarkOperation `json:"-"` // the client to operate on objects. It's safe to use a single client across multiple go routines. Client StorageInterface `json:"-"` // For burst mode a numberOfRuns is incremented for every loop. NumberOfRuns int `json:"-"` // The logger can be used from anywhere to log stuff InfoLogger *log2.Logger `json:"-"` WarningLogger *log2.Logger `json:"-"` ErrorLogger *log2.Logger `json:"-"` // Whether a connection pooling should be 'enabled' or 'disabled'. If not specified or set to 'mode' the default value of the BenchmarkMode is used. KeepAlive string `json:"-"` // contains filtered or unexported fields }
func FromJsonByteArray ¶
func FromJsonByteArray(jsonData []byte) (*BenchmarkContext, error)
func FromJsonFile ¶
func FromJsonFile(jsonFile string) (*BenchmarkContext, error)
func (*BenchmarkContext) NumberOfObjectsPerPayload ¶
func (ctx *BenchmarkContext) NumberOfObjectsPerPayload() int
func (*BenchmarkContext) NumberOfThreads ¶
func (ctx *BenchmarkContext) NumberOfThreads() int
func (*BenchmarkContext) PrintSettings ¶
func (ctx *BenchmarkContext) PrintSettings()
func (*BenchmarkContext) Start ¶
func (ctx *BenchmarkContext) Start() error
func (*BenchmarkContext) Validate ¶
func (ctx *BenchmarkContext) Validate() error
type BenchmarkMode ¶
type BenchmarkMode interface { DisableKeepAlives() bool PrintHeader(operationToTest string) PrintPayloadHeader(objectSize uint64, operationToTest string) PrintRecord(record Record) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64) CleanupTestdata(ctx *BenchmarkContext, payloadSize uint64) ExecuteBenchmark(ctx *BenchmarkContext, payloadSize uint64) IsFinished(numberOfRuns int) bool }
type BenchmarkOperation ¶
type BenchmarkOperation interface { EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64, ticker Ticker) Execute(ctx *BenchmarkContext, sampleId int, payloadSize uint64) Latency CleanupTestdata(ctx *BenchmarkContext, ticker Ticker) }
type BurstBenchmarkMode ¶
type BurstBenchmarkMode struct { }
func (*BurstBenchmarkMode) CleanupTestdata ¶
func (m *BurstBenchmarkMode) CleanupTestdata(ctx *BenchmarkContext, payloadSize uint64)
func (*BurstBenchmarkMode) DisableKeepAlives ¶
func (m *BurstBenchmarkMode) DisableKeepAlives() bool
func (*BurstBenchmarkMode) EnsureTestdata ¶
func (m *BurstBenchmarkMode) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64)
func (*BurstBenchmarkMode) ExecuteBenchmark ¶
func (m *BurstBenchmarkMode) ExecuteBenchmark(ctx *BenchmarkContext, payloadSize uint64)
func (*BurstBenchmarkMode) IsFinished ¶
func (m *BurstBenchmarkMode) IsFinished(numberOfRuns int) bool
func (*BurstBenchmarkMode) PrintFooter ¶
func (m *BurstBenchmarkMode) PrintFooter()
func (*BurstBenchmarkMode) PrintHeader ¶
func (m *BurstBenchmarkMode) PrintHeader(operationToTest string)
func (*BurstBenchmarkMode) PrintPayloadFooter ¶
func (m *BurstBenchmarkMode) PrintPayloadFooter()
func (*BurstBenchmarkMode) PrintPayloadHeader ¶
func (m *BurstBenchmarkMode) PrintPayloadHeader(objectSize uint64, operationToTest string)
func (*BurstBenchmarkMode) PrintRecord ¶
func (m *BurstBenchmarkMode) PrintRecord(record Record)
type ByDNSLookup ¶
type ByDNSLookup []Latency
comparator to sort by DNS lookup latency
func (ByDNSLookup) Len ¶
func (a ByDNSLookup) Len() int
func (ByDNSLookup) Less ¶
func (a ByDNSLookup) Less(i, j int) bool
func (ByDNSLookup) Swap ¶
func (a ByDNSLookup) Swap(i, j int)
type ByFirstByte ¶
type ByFirstByte []Latency
comparator to sort by first byte latency
func (ByFirstByte) Len ¶
func (a ByFirstByte) Len() int
func (ByFirstByte) Less ¶
func (a ByFirstByte) Less(i, j int) bool
func (ByFirstByte) Swap ¶
func (a ByFirstByte) Swap(i, j int)
type ByLastByte ¶
type ByLastByte []Latency
comparator to sort by last byte latency
func (ByLastByte) Len ¶
func (a ByLastByte) Len() int
func (ByLastByte) Less ¶
func (a ByLastByte) Less(i, j int) bool
func (ByLastByte) Swap ¶
func (a ByLastByte) Swap(i, j int)
type ByServerProcessing ¶
type ByServerProcessing []Latency
comparator to sort by server processing latency
func (ByServerProcessing) Len ¶
func (a ByServerProcessing) Len() int
func (ByServerProcessing) Less ¶
func (a ByServerProcessing) Less(i, j int) bool
func (ByServerProcessing) Swap ¶
func (a ByServerProcessing) Swap(i, j int)
type ByTCPConnection ¶
type ByTCPConnection []Latency
comparator to sort by TCP connection latency
func (ByTCPConnection) Len ¶
func (a ByTCPConnection) Len() int
func (ByTCPConnection) Less ¶
func (a ByTCPConnection) Less(i, j int) bool
func (ByTCPConnection) Swap ¶
func (a ByTCPConnection) Swap(i, j int)
type ByTLSHandshake ¶
type ByTLSHandshake []Latency
comparator to sort by TLS handshake latency
func (ByTLSHandshake) Len ¶
func (a ByTLSHandshake) Len() int
func (ByTLSHandshake) Less ¶
func (a ByTLSHandshake) Less(i, j int) bool
func (ByTLSHandshake) Swap ¶
func (a ByTLSHandshake) Swap(i, j int)
type ByThroughputBps ¶
type ByThroughputBps []Record
comparator to sort by throughput
func (ByThroughputBps) Len ¶
func (a ByThroughputBps) Len() int
func (ByThroughputBps) Less ¶
func (a ByThroughputBps) Less(i, j int) bool
func (ByThroughputBps) Swap ¶
func (a ByThroughputBps) Swap(i, j int)
type ByUnassigned ¶
type ByUnassigned []Latency
comparator to sort by unassigned latency
func (ByUnassigned) Len ¶
func (a ByUnassigned) Len() int
func (ByUnassigned) Less ¶
func (a ByUnassigned) Less(i, j int) bool
func (ByUnassigned) Swap ¶
func (a ByUnassigned) Swap(i, j int)
type FsObjectClient ¶
type FsObjectClient struct {
// contains filtered or unexported fields
}
func NewFsClient ¶
func NewFsClient(obConfig *FsObjectClientConfig) *FsObjectClient
func (*FsObjectClient) CreateBucket ¶
func (c *FsObjectClient) CreateBucket(bucketName string) (Latency, error)
func (*FsObjectClient) DeleteObject ¶
func (c *FsObjectClient) DeleteObject(bucketName string, key string) (Latency, error)
func (*FsObjectClient) GetObject ¶
func (c *FsObjectClient) GetObject(bucketName string, key string) (Latency, io.ReadCloser, error)
func (*FsObjectClient) HeadObject ¶
func (c *FsObjectClient) HeadObject(bucketName string, key string) (Latency, error)
type FsObjectClientConfig ¶
type FsObjectClientConfig struct {
RootPath string
}
type Latency ¶
type Latency struct { FirstByte time.Duration LastByte time.Duration DNSLookup time.Duration TCPConnection time.Duration TLSHandshake time.Duration ServerProcessing time.Duration Errors []error }
Represents the duration from making different parts of an operation including the time to first byte (TTFB) and the time to last byte (TTLB).
func (*Latency) Unassigned ¶
type LatencyBenchmarkMode ¶
type LatencyBenchmarkMode struct { }
func (*LatencyBenchmarkMode) CleanupTestdata ¶
func (m *LatencyBenchmarkMode) CleanupTestdata(ctx *BenchmarkContext, payloadSize uint64)
func (*LatencyBenchmarkMode) DisableKeepAlives ¶
func (m *LatencyBenchmarkMode) DisableKeepAlives() bool
func (*LatencyBenchmarkMode) EnsureTestdata ¶
func (m *LatencyBenchmarkMode) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64)
func (*LatencyBenchmarkMode) ExecuteBenchmark ¶
func (m *LatencyBenchmarkMode) ExecuteBenchmark(ctx *BenchmarkContext, payloadSize uint64)
func (*LatencyBenchmarkMode) IsFinished ¶
func (m *LatencyBenchmarkMode) IsFinished(numberOfRuns int) bool
func (*LatencyBenchmarkMode) PrintFooter ¶
func (m *LatencyBenchmarkMode) PrintFooter()
func (*LatencyBenchmarkMode) PrintHeader ¶
func (m *LatencyBenchmarkMode) PrintHeader(operationToTest string)
func (*LatencyBenchmarkMode) PrintPayloadFooter ¶
func (m *LatencyBenchmarkMode) PrintPayloadFooter()
func (*LatencyBenchmarkMode) PrintPayloadHeader ¶
func (m *LatencyBenchmarkMode) PrintPayloadHeader(objectSize uint64, operationToTest string)
func (*LatencyBenchmarkMode) PrintRecord ¶
func (m *LatencyBenchmarkMode) PrintRecord(record Record)
type OperationRead ¶
type OperationRead struct {
// contains filtered or unexported fields
}
func (*OperationRead) CleanupTestdata ¶
func (op *OperationRead) CleanupTestdata(ctx *BenchmarkContext, ticker Ticker)
func (*OperationRead) EnsureTestdata ¶
func (op *OperationRead) EnsureTestdata(ctx *BenchmarkContext, payloadSize uint64, ticker Ticker)
func (*OperationRead) Execute ¶
func (op *OperationRead) Execute(ctx *BenchmarkContext, sampleId int, payloadSize uint64) Latency
type OperationWrite ¶
type OperationWrite struct {
// contains filtered or unexported fields
}
func (*OperationWrite) CleanupTestdata ¶
func (op *OperationWrite) CleanupTestdata(ctx *BenchmarkContext, ticker Ticker)
func (*OperationWrite) EnsureTestdata ¶
func (op *OperationWrite) EnsureTestdata(ctx *BenchmarkContext, payloadSite uint64, ticker Ticker)
func (*OperationWrite) Execute ¶
func (op *OperationWrite) Execute(ctx *BenchmarkContext, sampleId int, payloadSize uint64) Latency
type Record ¶
type Record struct { Operation string `json:"operation"` // read, write, ... TotalBytes uint64 `json:"total_bytes"` ObjectSizeBytes uint64 `json:"object_size_bytes"` // deprecated field for TotalBytes. SingleObjectSize uint64 `json:"single_object_size_bytes"` ObjectsCount uint64 `json:"objects_count"` DurationSeconds float64 `json:"duration_secs"` Threads int `json:"threads"` TimeToFirstByte map[string]float64 `json:"ttfb_latency_ms"` TimeToLastByte map[string]float64 `json:"ttlb_latency_ms"` DNSLookup map[string]float64 `json:"dns_latency_ms"` TCPConnection map[string]float64 `json:"tcp_latency_ms"` TLSHandshake map[string]float64 `json:"tls_latency_ms"` ServerProcessing map[string]float64 `json:"server_latency_ms"` Unassigned map[string]float64 `json:"unassigned_latency_ms"` Throughput map[string]float64 `json:"throughput"` }
func (*Record) ThroughputBps ¶
func (*Record) ThroughputMBps ¶
type Report ¶
type Report struct { Uuid string `json:"uuid"` // A unique id for this benchmark report. Description string `json:"description"` // An optional description that helps to identify the test run ClientEnv string `json:"client_env"` // Description of the environment from which the benchmark has been executed. ServerEnv string `json:"server_env"` // Description of the environment of the test target. DateTimeUTC string `json:"datetime_utc"` Records []Record `json:"records"` }
type S3ObjectClient ¶
type S3ObjectClient struct {
// contains filtered or unexported fields
}
func (*S3ObjectClient) CreateBucket ¶
func (c *S3ObjectClient) CreateBucket(bucketName string) (Latency, error)
func (*S3ObjectClient) DeleteObject ¶
func (c *S3ObjectClient) DeleteObject(bucketName string, key string) (Latency, error)
func (*S3ObjectClient) GetObject ¶
func (c *S3ObjectClient) GetObject(bucketName string, key string) (Latency, io.ReadCloser, error)
func (*S3ObjectClient) HeadObject ¶
func (c *S3ObjectClient) HeadObject(bucketName string, key string) (Latency, error)
type S3ObjectClientConfig ¶
type StorageInterface ¶
type StorageInterface interface { CreateBucket(bucketName string) (Latency, error) HeadObject(bucket string, key string) (Latency, error) PutObject(bucket string, key string, reader *bytes.Reader) (Latency, error) GetObject(bucket string, key string) (Latency, io.ReadCloser, error) DeleteObject(bucket string, key string) (Latency, error) }
Abstraction of storage operations (file, object, ...)
func NewS3Client ¶
func NewS3Client(obConfig *S3ObjectClientConfig) StorageInterface
Click to show internal directories.
Click to hide internal directories.