bulk_query

package
v0.0.0-...-b673533 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dashboard       = "dashboard"
	AllQueriesLabel = "all queries"
)

Variables

View Source
var Benchmarker = &QueryBenchmarker{}

Functions

This section is empty.

Types

type BulkQuery

type BulkQuery interface {
	Init()
	Validate()
	Prepare()
	GetProcessor() Processor
	GetScanner() Scanner
	CleanUp()
	UpdateReport(params *report.QueryReportParams, reportTags [][2]string, extraVals []report.ExtraVal) ([][2]string, []report.ExtraVal)
}

type HistoryItem

type HistoryItem struct {
	Value float64
	Item  int
}

type Processor

type Processor interface {
	PrepareProcess(i int)
	RunProcess(i int, qorkersGroup *sync.WaitGroup, statPool sync.Pool, statChan chan *Stat)
}

type QueryBenchmarker

type QueryBenchmarker struct {
	// contains filtered or unexported fields
}

func (QueryBenchmarker) BatchSize

func (q QueryBenchmarker) BatchSize() int

func (QueryBenchmarker) BurnIn

func (q QueryBenchmarker) BurnIn() uint64

func (QueryBenchmarker) Debug

func (q QueryBenchmarker) Debug() int

func (QueryBenchmarker) GradualWorkersIncrease

func (q QueryBenchmarker) GradualWorkersIncrease() bool

func (*QueryBenchmarker) Init

func (q *QueryBenchmarker) Init()

func (QueryBenchmarker) Limit

func (q QueryBenchmarker) Limit() int64

func (QueryBenchmarker) PrettyPrintResponses

func (q QueryBenchmarker) PrettyPrintResponses() bool

func (*QueryBenchmarker) RunBenchmark

func (q *QueryBenchmarker) RunBenchmark(bulkQuery BulkQuery)

func (*QueryBenchmarker) Validate

func (q *QueryBenchmarker) Validate()

func (QueryBenchmarker) WaitInterval

func (q QueryBenchmarker) WaitInterval() time.Duration

type Scanner

type Scanner interface {
	RunScan(r io.Reader, closeChan chan int)
	IsScanFinished() bool
}

type SimpleRegression

type SimpleRegression struct {
	// contains filtered or unexported fields
}

func (*SimpleRegression) Intercept

func (sr *SimpleRegression) Intercept() float64

func (*SimpleRegression) Slope

func (sr *SimpleRegression) Slope() float64

func (*SimpleRegression) Update

func (sr *SimpleRegression) Update(x, y float64)

type Stat

type Stat struct {
	Label    []byte
	Value    float64
	IsActual bool
}

Stat represents one statistical measurement.

func (*Stat) Init

func (s *Stat) Init(label []byte, value float64)

Init safely initializes a stat while minimizing heap allocations.

func (*Stat) InitWithActual

func (s *Stat) InitWithActual(label []byte, value float64, isActual bool)

type StatGroup

type StatGroup struct {
	Min  float64
	Max  float64
	Mean float64
	Sum  float64

	Count int64
}

StatGroup collects simple streaming statistics.

func (*StatGroup) Push

func (s *StatGroup) Push(n float64)

Push updates a StatGroup with a new Value.

func (*StatGroup) String

func (s *StatGroup) String() string

String makes a simple description of a StatGroup.

type StatsMap

type StatsMap map[string]*StatGroup

type TimedStatGroup

type TimedStatGroup struct {
	// contains filtered or unexported fields
}

func NewTimedStatGroup

func NewTimedStatGroup(maxDuration time.Duration, maxTrendSamples int) *TimedStatGroup

func (*TimedStatGroup) Avg

func (m *TimedStatGroup) Avg() float64

func (*TimedStatGroup) FindHistoryItemBelow

func (m *TimedStatGroup) FindHistoryItemBelow(val float64) *HistoryItem

func (*TimedStatGroup) Median

func (m *TimedStatGroup) Median() float64

func (*TimedStatGroup) Push

func (m *TimedStatGroup) Push(timestamp time.Time, value float64)

func (*TimedStatGroup) UpdateAvg

func (m *TimedStatGroup) UpdateAvg(now time.Time, workers int) (float64, float64)

type TrendStat

type TrendStat struct {
	// contains filtered or unexported fields
}

func NewTrendStat

func NewTrendStat(size int, skipFirst bool) *TrendStat

func (*TrendStat) Add

func (ls *TrendStat) Add(y float64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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