aggregate

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BPSorOPS

func BPSorOPS(bps, ops float64) string

BPSorOPS returns bytes per second if non zero otherwise operations per second as human readable string.

func RequestAnalysisHostsMultiSized

func RequestAnalysisHostsMultiSized(o bench.Operations) map[string]RequestSizeRange

RequestAnalysisHostsMultiSized performs host analysis where objects have different sizes.

func RequestAnalysisHostsSingleSized

func RequestAnalysisHostsSingleSized(o bench.Operations) map[string]SingleSizedRequests

RequestAnalysisHostsSingleSized performs host analysis where all objects have equal size.

Types

type Aggregated

type Aggregated struct {
	// MixedServerStats and MixedThroughputByHost is populated only when data is mixed.
	MixedServerStats      *Throughput           `json:"mixed_server_stats,omitempty"`
	MixedThroughputByHost map[string]Throughput `json:"mixed_throughput_by_host,omitempty"`
	Type                  string                `json:"type"`
	Operations            []Operation           `json:"operations,omitempty"`
	Mixed                 bool                  `json:"mixed"`
}

Aggregated contains aggregated data for a single benchmark run.

func Aggregate

func Aggregate(o bench.Operations, opts Options) Aggregated

Aggregate returns statistics when only a single operation was running concurrently.

type MultiSizedRequests

type MultiSizedRequests struct {
	// ByHost contains request information by host.
	ByHost map[string]RequestSizeRange `json:"by_host,omitempty"`

	// BySize contains request times separated by sizes
	BySize []RequestSizeRange `json:"by_size"`

	// HostNames are the host names, sorted.
	HostNames []string

	// Total number of requests.
	Requests int `json:"requests"`
	// Average object size
	AvgObjSize int64 `json:"avg_obj_size"`

	// Skipped if too little data.
	Skipped bool `json:"skipped"`
}

MultiSizedRequests contains statistics when objects have the same different size.

func RequestAnalysisMultiSized

func RequestAnalysisMultiSized(o bench.Operations, allThreads bool) *MultiSizedRequests

RequestAnalysisMultiSized performs analysis where objects have different sizes.

type Operation

type Operation struct {
	// Throughput information.
	Throughput Throughput `json:"throughput"`
	// Unfiltered start time of this operation segment.
	StartTime time.Time `json:"start_time"`
	// Unfiltered end time of this operation segment.
	EndTime time.Time `json:"end_time"`
	// Throughput by host.
	ThroughputByHost map[string]Throughput `json:"throughput_by_host"`
	// Populated if requests are of difference object sizes.
	MultiSizedRequests *MultiSizedRequests `json:"multi_sized_requests,omitempty"`
	// Populated if requests are all of same object size.
	SingleSizedRequests *SingleSizedRequests `json:"single_sized_requests,omitempty"`
	// Operation type
	Type string `json:"type"`
	// HostNames are sorted names of hosts
	HostNames []string `json:"host_names"`
	// Subset of errors.
	FirstErrors []string `json:"first_errors"`
	// Numbers of hosts
	Hosts int `json:"hosts"`
	// Number of warp clients.
	Clients int `json:"clients"`
	// Concurrency - total number of threads running.
	Concurrency int `json:"concurrency"`
	// Total errors recorded.
	Errors int `json:"errors"`
	// Objects per operation.
	ObjectsPerOperation int `json:"objects_per_operation"`
	// N is the number of operations.
	N int `json:"n"`
	// Skipped if too little data
	Skipped bool `json:"skipped"`
}

Operation returns statistics for a single operation type.

type Options added in v0.3.25

type Options struct {
	DurFunc     SegmentDurFn
	SkipDur     time.Duration
	Prefiltered bool
}

type RequestSizeRange

type RequestSizeRange struct {
	// Time to first byte if applicable.
	FirstByte *TTFB `json:"first_byte,omitempty"`

	// FirstAccess is filled if the same object is accessed multiple times.
	// This records the first touch of the object.
	FirstAccess *RequestSizeRange `json:"first_access,omitempty"`

	MinSizeString string `json:"min_size_string"`
	MaxSizeString string `json:"max_size_string"`

	// BpsPct is BPS percentiles.
	BpsPct [101]float64 `json:"bps_percentiles"`

	BpsMedian         float64 `json:"bps_median"`
	AvgDurationMillis int     `json:"avg_duration_millis"`

	// Stats:
	BpsAverage float64 `json:"bps_average"`
	// Number of requests in this range.
	Requests   int     `json:"requests"`
	Bps90      float64 `json:"bps_90"`
	Bps99      float64 `json:"bps_99"`
	BpsFastest float64 `json:"bps_fastest"`
	BpsSlowest float64 `json:"bps_slowest"`

	// Average payload size of requests in bytes.
	AvgObjSize int `json:"avg_obj_size"`
	// Maximum size in request size range (not included).
	MaxSize int `json:"max_size"`
	// Minimum size in request size range.
	MinSize int `json:"min_size"`
}

type SegmentDurFn added in v0.3.24

type SegmentDurFn func(total time.Duration) time.Duration

SegmentDurFn accepts a total time and should return the duration used for each segment.

type SegmentSmall

type SegmentSmall struct {
	// Start time of the segment.
	Start time.Time `json:"start"`
	// Bytes per second during the time segment.
	BPS float64 `json:"bytes_per_sec"`

	// Operations per second during the time segment.
	OPS float64 `json:"obj_per_sec"`

	// Errors logged during the time segment.
	Errors int `json:"errors,omitempty"`
}

SegmentSmall represents a time segment of the run. Length of the segment is defined elsewhere.

func (SegmentSmall) StringLong

func (s SegmentSmall) StringLong(d time.Duration, details bool) string

StringLong returns a long string representation of the segment.

type SingleSizedRequests

type SingleSizedRequests struct {
	// Request times by host.
	ByHost     map[string]SingleSizedRequests `json:"by_host,omitempty"`
	LastAccess *SingleSizedRequests           `json:"last_access,omitempty"`

	// FirstAccess is filled if the same object is accessed multiple times.
	// This records the first touch of the object.
	FirstAccess *SingleSizedRequests `json:"first_access,omitempty"`

	// Time to first byte if applicable.
	FirstByte *TTFB `json:"first_byte,omitempty"`

	// Host names, sorted.
	HostNames []string

	// DurPct is duration percentiles.
	DurPct [101]int `json:"dur_percentiles_millis"`

	// Median request duration.
	DurMedianMillis int `json:"dur_median_millis"`

	// Fastest request time.
	FastestMillis int `json:"fastest_millis"`

	// Slowest request time.
	SlowestMillis int `json:"slowest_millis"`

	// StdDev is the standard deviation of requests.
	StdDev int `json:"std_dev_millis"`

	// 99% request time.
	Dur99Millis int `json:"dur_99_millis"`

	// 90% request time.
	Dur90Millis int `json:"dur_90_millis"`

	// Average request duration.
	DurAvgMillis int `json:"dur_avg_millis"`

	// Total number of requests.
	Requests int `json:"requests"`

	// Object size per operation. Can be 0.
	ObjSize int64 `json:"obj_size"`

	// Skipped if too little data.
	Skipped bool `json:"skipped"`
}

SingleSizedRequests contains statistics when all objects have the same size.

func RequestAnalysisSingleSized

func RequestAnalysisSingleSized(o bench.Operations, allThreads bool) *SingleSizedRequests

RequestAnalysisSingleSized performs analysis where all objects have equal size.

type TTFB

type TTFB struct {
	AverageMillis     int      `json:"average_millis"`
	FastestMillis     int      `json:"fastest_millis"`
	P25Millis         int      `json:"p25_millis"`
	MedianMillis      int      `json:"median_millis"`
	P75Millis         int      `json:"p75_millis"`
	P90Millis         int      `json:"p90_millis"`
	P99Millis         int      `json:"p99_millis"`
	SlowestMillis     int      `json:"slowest_millis"`
	StdDevMillis      int      `json:"std_dev_millis"`
	PercentilesMillis [101]int `json:"percentiles_millis"`
}

TTFB contains times to first byte if applicable.

func TtfbFromBench

func TtfbFromBench(t bench.TTFB) *TTFB

TtfbFromBench converts from bench.TTFB

func (TTFB) String

func (t TTFB) String() string

String returns a human printable version of the time to first byte.

type Throughput

type Throughput struct {
	// Start time of the measurement.
	StartTime time.Time `json:"start_time"`
	// End time of the measurement.
	EndTime time.Time `json:"end_time"`
	// Time segmented throughput summary.
	Segmented *ThroughputSegmented `json:"segmented,omitempty"`
	// Errors recorded.
	Errors int `json:"errors"`
	// Time period of the throughput measurement.
	MeasureDurationMillis int `json:"measure_duration_millis"`
	// Average bytes per second. Can be 0.
	AverageBPS float64 `json:"average_bps"`
	// Average operations per second.
	AverageOPS float64 `json:"average_ops"`
	// Number of full operations
	Operations int `json:"operations"`
}

Throughput contains throughput.

func (Throughput) String

func (t Throughput) String() string

String returns a string representation of the segment

func (Throughput) StringDetails added in v0.3.18

func (t Throughput) StringDetails(_ bool) string

StringDetails returns a detailed string representation of the segment

func (Throughput) StringDuration added in v0.3.21

func (t Throughput) StringDuration() string

StringDuration returns a string representation of the segment duration

type ThroughputSegmented

type ThroughputSegmented struct {
	// Start time of fastest time segment.
	FastestStart time.Time `json:"fastest_start"`
	// 50% Median....
	MedianStart time.Time `json:"median_start"`
	// Slowest ...
	SlowestStart time.Time `json:"slowest_start"`
	// Will contain how segments are sorted.
	// Will be 'bps' (bytes per second) or 'ops' (objects per second).
	SortedBy string `json:"sorted_by"`

	// All segments, sorted
	Segments []SegmentSmall `json:"segments"`

	// Time of each segment.
	SegmentDurationMillis int `json:"segment_duration_millis"`
	// Fastest segment bytes per second. Can be 0. In that case segments are sorted by operations per second.
	FastestBPS float64 `json:"fastest_bps"`
	// Fastest segment in terms of operations per second.
	FastestOPS float64 `json:"fastest_ops"`
	MedianBPS  float64 `json:"median_bps"`
	MedianOPS  float64 `json:"median_ops"`
	SlowestBPS float64 `json:"slowest_bps"`
	SlowestOPS float64 `json:"slowest_ops"`
}

ThroughputSegmented contains time segmented throughput statics.

Jump to

Keyboard shortcuts

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