report - ActiveState ActiveGo 1.8
...

Package report

import "github.com/coreos/etcd/pkg/report"
Overview
Index

Overview ▾

Package report generates human-readable benchmark reports.

func Percentiles

func Percentiles(nums []float64) (pcs []float64, data []float64)

Percentiles returns percentile distribution of float64 slice.

type DataPoint

type DataPoint struct {
    Timestamp  int64
    MinLatency time.Duration
    AvgLatency time.Duration
    MaxLatency time.Duration
    ThroughPut int64
}

type Report

Report processes a result stream until it is closed, then produces a string with information about the consumed result data.

type Report interface {
    Results() chan<- Result

    // Run returns results in print-friendly format.
    Run() <-chan string

    // Stats returns results in raw data.
    Stats() <-chan Stats
}

func NewReport

func NewReport(precision string) Report

func NewReportRate

func NewReportRate(precision string) Report

func NewReportSample

func NewReportSample(precision string) Report

func NewWeightedReport

func NewWeightedReport(r Report, precision string) Report

NewWeightedReport returns a report that includes both weighted and unweighted statistics.

type Result

Result describes the timings for an operation.

type Result struct {
    Start  time.Time
    End    time.Time
    Err    error
    Weight float64
}

func (*Result) Duration

func (res *Result) Duration() time.Duration

type Stats

Stats exposes results raw data.

type Stats struct {
    AvgTotal   float64
    Fastest    float64
    Slowest    float64
    Average    float64
    Stddev     float64
    RPS        float64
    Total      time.Duration
    ErrorDist  map[string]int
    Lats       []float64
    TimeSeries TimeSeries
}

type TimeSeries

type TimeSeries []DataPoint

func (TimeSeries) Len

func (t TimeSeries) Len() int

func (TimeSeries) Less

func (t TimeSeries) Less(i, j int) bool

func (TimeSeries) String

func (ts TimeSeries) String() string

func (TimeSeries) Swap

func (t TimeSeries) Swap(i, j int)