Versions in this module Expand all Collapse all v1 v1.0.0 Jan 10, 2022 Changes in this version + const AlignCenter + const AlignLeft + const AlignRight + const FgBlackColor + const FgBlueColor + const FgCyanColor + const FgGreenColor + const FgMagentaColor + const FgRedColor + const FgWhiteColor + const FgYellowColor + const PageTpl + const ViewTpl + var ErrNoop = errors.New("noop") + var IsStdoutTerminal = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) + func StartBench(ctx context.Context, fn Benchable, fns ...ConfigFn) + type BenchEmpty struct + func (f *BenchEmpty) Final(context.Context, *Config) error + func (f *BenchEmpty) Init(context.Context, *Config) error + func (f *BenchEmpty) Invoke(context.Context, *Config) (*Result, error) + func (f *BenchEmpty) Name(context.Context, *Config) string + type BenchOption struct + NoReport bool + type Benchable interface + Final func(context.Context, *Config) error + Init func(context.Context, *Config) (*BenchOption, error) + Invoke func(context.Context, *Config) (*Result, error) + Name func(context.Context, *Config) string + type Charts struct + func NewCharts(chartsData func() *ChartsReport, config *Config) *Charts + func (c *Charts) Handler(ctx *fasthttp.RequestCtx) + func (c *Charts) Serve(ln net.Listener, port int) + type ChartsReport struct + Concurrent int64 + Latency []util.Float64 + LatencyPercentiles []util.Float64 + RPS util.Float64 + type Config struct + ChartPort int + CountingName string + Desc string + Duration time.Duration + FeaturesConf string + GoMaxProcs int + Goroutines int + Incr util.GoroutineIncr + N int + OkStatus string + PlotsFile string + PlotsHandle *util.JSONLogFile + Qps float64 + ThinkTime string + Verbose int + func (c *Config) Description(benchableName string) string + func (c *Config) IsDryPlots() bool + func (c *Config) NewRequester(ctx context.Context, fn Benchable) *Requester + func (c *Config) Setup() + type ConfigFn func(*Config) + func WithConfig(v *Config) ConfigFn + func WithCounting(name string) ConfigFn + func WithOkStatus(okStatus string) ConfigFn + type F func(context.Context, *Config) (*Result, error) + func (f F) Final(context.Context, *Config) error + func (f F) Init(context.Context, *Config) (*BenchOption, error) + func (f F) Invoke(ctx context.Context, c *Config) (*Result, error) + func (f F) Name(context.Context, *Config) string + type Metrics struct + Time string + Values map[string]interface{} + type PercentileReport map[string]string + type Printer struct + func (p *Printer) PrintLoop(snapshot func() *SnapshotReport, doneChan <-chan struct{}, requests int) + type Report struct + type ReportRecord struct + func (r ReportRecord) Reset() + type Requester struct + QPS float64 + type Result struct + Cost time.Duration + Counting []string + ReadBytes int64 + Status []string + WriteBytes int64 + type SnapshotHistogram struct + Count int + Mean time.Duration + type SnapshotPercentile struct + Latency time.Duration + Percentile float64 + type SnapshotReport struct + Codes map[string]int64 + Count int64 + Counting int64 + ElapseInSec float64 + Elapsed time.Duration + Errors map[string]int64 + Histograms []*SnapshotHistogram + Percentiles []*SnapshotPercentile + RPS float64 + ReadThroughput float64 + RpsStats *SnapshotRpsStats + Stats *SnapshotStats + WriteThroughput float64 + type SnapshotRpsStats struct + Max float64 + Mean float64 + Min float64 + StdDev float64 + type SnapshotStats struct + Max time.Duration + Mean time.Duration + Min time.Duration + StdDev time.Duration + type StatItem struct + Max string + Mean string + Min string + StdDev string + type Stats struct + func (s *Stats) Mean() float64 + func (s *Stats) Reset() + func (s *Stats) Stddev() float64 + func (s *Stats) Update(v float64) + type StatsReport struct + Latency StatItem + RPS StatItem + type StreamReport struct + func NewStreamReport(requester *Requester) *StreamReport + func (s *StreamReport) Charts() *ChartsReport + func (s *StreamReport) Collect(records <-chan *ReportRecord) + func (s *StreamReport) Done() <-chan struct{} + func (s *StreamReport) Snapshot() *SnapshotReport + type SummaryReport struct + Count int64 + Counting int64 + Elapsed string + RPS string + ReadsWrites string + type Views struct + func NewViews(size string, dryPlots bool) *Views