Documentation ¶
Index ¶
- Constants
- Variables
- func StartBench(ctx context.Context, fn Benchable, fns ...ConfigFn)
- type BenchEmpty
- type BenchOption
- type Benchable
- type Charts
- type ChartsReport
- type Config
- type ConfigFn
- type F
- type Metrics
- type PercentileReport
- type Printer
- type Report
- type ReportRecord
- type Requester
- type Result
- type SnapshotHistogram
- type SnapshotPercentile
- type SnapshotReport
- type SnapshotRpsStats
- type SnapshotStats
- type StatItem
- type Stats
- type StatsReport
- type StreamReport
- type SummaryReport
- type Views
Constants ¶
View Source
const ( ViewTpl = ` $(function () { {{ .SetInterval }}(views_sync, {{ .Interval }}); }); let views = {{.ViewsMap}}; {{.ViewSyncJS}} ` PageTpl = `` /* 358-byte string literal not displayed */ )
View Source
const ( FgBlackColor int = iota + 30 FgRedColor FgGreenColor FgYellowColor FgBlueColor FgMagentaColor FgCyanColor FgWhiteColor )
View Source
const ( AlignLeft = iota AlignRight AlignCenter )
Variables ¶
View Source
var ErrNoop = errors.New("noop")
ErrNoop means there is no operation defined.
View Source
var (
IsStdoutTerminal = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
)
Functions ¶
Types ¶
type BenchEmpty ¶
type BenchEmpty struct{}
type BenchOption ¶
type BenchOption struct {
NoReport bool
}
type Charts ¶
type Charts struct {
// contains filtered or unexported fields
}
func NewCharts ¶
func NewCharts(chartsData func() *ChartsReport, config *Config) *Charts
func (*Charts) Handler ¶
func (c *Charts) Handler(ctx *fasthttp.RequestCtx)
type ChartsReport ¶
type Config ¶
type Config struct { N int Goroutines int Duration time.Duration Incr util.GoroutineIncr GoMaxProcs int Qps float64 FeaturesConf string Verbose int ThinkTime string ChartPort int util.Features CountingName string OkStatus string PlotsFile string PlotsHandle *util.JSONLogFile Desc string }
Config defines the bench configuration.
func (*Config) Description ¶
func (*Config) IsDryPlots ¶
func (*Config) NewRequester ¶
type ConfigFn ¶
type ConfigFn func(*Config)
func WithOkStatus ¶
WithOkStatus set the status which represents OK.
type PercentileReport ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
func (*Printer) PrintLoop ¶
func (p *Printer) PrintLoop(snapshot func() *SnapshotReport, doneChan <-chan struct{}, requests int)
type Report ¶
type Report struct { SummaryReport `json:"Summary"` StatsReport `json:"Stats"` PercentileReport `json:"Percentile"` }
type ReportRecord ¶
type ReportRecord struct {
// contains filtered or unexported fields
}
func (ReportRecord) Reset ¶
func (r ReportRecord) Reset()
type Requester ¶
type Requester struct { // Qps is the rate limit in queries per second. QPS float64 // contains filtered or unexported fields }
type SnapshotHistogram ¶
type SnapshotPercentile ¶
type SnapshotReport ¶
type SnapshotReport struct { Elapsed time.Duration Codes, Errors map[string]int64 RPS, ElapseInSec float64 ReadThroughput, WriteThroughput float64 Count, Counting int64 Stats *SnapshotStats RpsStats *SnapshotRpsStats Percentiles []*SnapshotPercentile Histograms []*SnapshotHistogram }
type SnapshotRpsStats ¶
type SnapshotRpsStats struct {
Min, Mean, StdDev, Max float64
}
type SnapshotStats ¶
type StatsReport ¶
type StreamReport ¶
type StreamReport struct {
// contains filtered or unexported fields
}
func NewStreamReport ¶
func NewStreamReport(requester *Requester) *StreamReport
func (*StreamReport) Charts ¶
func (s *StreamReport) Charts() *ChartsReport
func (*StreamReport) Collect ¶
func (s *StreamReport) Collect(records <-chan *ReportRecord)
func (*StreamReport) Done ¶
func (s *StreamReport) Done() <-chan struct{}
func (*StreamReport) Snapshot ¶
func (s *StreamReport) Snapshot() *SnapshotReport
type SummaryReport ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pkg
|
|
blow/lossy
Package lossy simulates bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces.
|
Package lossy simulates bandwidth, latency and packet loss for net.PacketConn and net.Conn interfaces. |
Click to show internal directories.
Click to hide internal directories.