aggregate

package
v0.0.0-...-9e44328 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildStatKey

func BuildStatKey(s *stat.Stat) (indexKey, queryKey *StatKey, statIndex, statQueries []StatQuery)

func GreaterIndexAggByErrors

func GreaterIndexAggByErrors(a, b *StatIndexAggNode) bool

func GreaterIndexAggByQueries

func GreaterIndexAggByQueries(a, b *StatIndexAggNode) bool

func GreaterIndexAggMaxByRows

func GreaterIndexAggMaxByRows(a, b *StatIndexAggNode) bool

func GreaterIndexAggMaxByTime

func GreaterIndexAggMaxByTime(a, b *StatIndexAggNode) bool

func GreaterIndexAggP50ByRows

func GreaterIndexAggP50ByRows(a, b *StatIndexAggNode) bool

func GreaterIndexAggP50ByTime

func GreaterIndexAggP50ByTime(a, b *StatIndexAggNode) bool

func GreaterIndexAggP90ByRows

func GreaterIndexAggP90ByRows(a, b *StatIndexAggNode) bool

func GreaterIndexAggP90ByTime

func GreaterIndexAggP90ByTime(a, b *StatIndexAggNode) bool

func GreaterIndexAggP95ByRows

func GreaterIndexAggP95ByRows(a, b *StatIndexAggNode) bool

func GreaterIndexAggP95ByTime

func GreaterIndexAggP95ByTime(a, b *StatIndexAggNode) bool

func GreaterIndexAggP99ByRows

func GreaterIndexAggP99ByRows(a, b *StatIndexAggNode) bool

func GreaterIndexAggP99ByTime

func GreaterIndexAggP99ByTime(a, b *StatIndexAggNode) bool

func IndexSortStrings

func IndexSortStrings() []string

func LabelsSort

func LabelsSort(keys []LabelKey)

func LessDataAggMaxByRows

func LessDataAggMaxByRows(a, b *StatRequestAggNode) bool

func LessDataAggMedianByRows

func LessDataAggMedianByRows(a, b *StatRequestAggNode) bool

func LessDataAggP90ByRows

func LessDataAggP90ByRows(a, b *StatRequestAggNode) bool

func LessDataAggP95ByRows

func LessDataAggP95ByRows(a, b *StatRequestAggNode) bool

func LessDataAggP99ByRows

func LessDataAggP99ByRows(a, b *StatRequestAggNode) bool

func LessDataAggSumByErrors

func LessDataAggSumByErrors(a, b *StatRequestAggNode) bool

func RequestSortStrings

func RequestSortStrings() []string

func SortIndexAgg

func SortIndexAgg(statIndexAgg []*StatIndexAggNode, indexSort IndexSort, indexKey AggSortKey)

func SortKeyStrings

func SortKeyStrings() []string

Types

type AggNode

type AggNode struct {
	Min float64
	Max float64
	P50 float64
	P90 float64
	P95 float64
	P99 float64
}

func (*AggNode) Calc

func (a *AggNode) Calc(values []float64) error

type AggSortKey

type AggSortKey int8
const (
	AggSortMax AggSortKey = iota
	AggSortP99
	AggSortP95
	AggSortP90
	AggSortP50
)

func (*AggSortKey) Get

func (s *AggSortKey) Get() interface{}

func (*AggSortKey) GetSortKey

func (s *AggSortKey) GetSortKey() AggSortKey

func (*AggSortKey) Reset

func (s *AggSortKey) Reset(i interface{})

func (*AggSortKey) Set

func (s *AggSortKey) Set(value string, _ bool) error

func (*AggSortKey) String

func (s *AggSortKey) String() string

func (*AggSortKey) Type

func (s *AggSortKey) Type() string

type IndexSort

type IndexSort int8
const (
	IndexSortTime IndexSort = iota
	IndexSortReadRows
	IndexSortQueries
	IndexSortErrors
)

func (*IndexSort) Get

func (s *IndexSort) Get() interface{}

func (*IndexSort) GetSort

func (s *IndexSort) GetSort() IndexSort

func (*IndexSort) Reset

func (s *IndexSort) Reset(i interface{})

func (*IndexSort) Set

func (s *IndexSort) Set(value string, _ bool) error

func (*IndexSort) String

func (s *IndexSort) String() string

func (*IndexSort) Type

func (s *IndexSort) Type() string

type LabelKey

type LabelKey struct {
	RequestType   string `json:"requestType"`
	DurationLabel string `json:"durationLabel"`
	OffsetLabel   string `json:"OffsetLabel"`
}

func BuildLabelKey

func BuildLabelKey(k StatKey) LabelKey

func (*LabelKey) MarshalJSON

func (k *LabelKey) MarshalJSON() ([]byte, error)

type RequestSort

type RequestSort int8
const (
	RequestSortQTime RequestSort = iota
	RequestSortRTime
	RequestSortDTime
	RequestSortReadRows
	RequestSortIndexReadRows
	RequestSortDataReadRows
	RequestSortQueries
	RequestSortErrors
)

func (*RequestSort) Get

func (s *RequestSort) Get() interface{}

func (*RequestSort) GetSort

func (s *RequestSort) GetSort() RequestSort

func (*RequestSort) Reset

func (s *RequestSort) Reset(i interface{})

func (*RequestSort) Set

func (s *RequestSort) Set(value string, _ bool) error

func (*RequestSort) String

func (s *RequestSort) String() string

func (*RequestSort) Type

func (s *RequestSort) Type() string

type StatAggSum

type StatAggSum struct {
	Index map[LabelKey][]*StatIndexAggNode
	// DataIndex map[StatKey]*StatIndexAggNode
	Requests map[LabelKey][]*StatRequestAggNode
}

func NewAggSummary

func NewAggSummary() *StatAggSum

func (*StatAggSum) IndexLabels

func (aggSum *StatAggSum) IndexLabels() []LabelKey

func (*StatAggSum) RequestLabels

func (aggSum *StatAggSum) RequestLabels() []LabelKey

func (*StatAggSum) Slice

func (aSum *StatAggSum) Slice() StatAggSumSlice

type StatAggSumSlice

type StatAggSumSlice struct {
	Index    []*StatIndexAggNode
	Requests []*StatRequestAggNode
}

type StatIndexAggNode

type StatIndexAggNode struct {
	IndexKey StatKey

	Queries []StatQuery

	SampleId string
	ErrorId  string

	N          int64
	ErrorsPcnt float64

	Metrics AggNode

	IndexCacheHitPcnt float64

	ReadRows  AggNode
	ReadBytes AggNode
	Times     AggNode
}

type StatIndexNode

type StatIndexNode struct {
	IndexKey StatKey

	Queries []StatQuery

	SampleId string

	ErrorId string

	N      int64
	Errors int64

	Metrics []float64

	IndexCacheHit  int64
	IndexCacheMiss int64

	ReadRows  []float64
	ReadBytes []float64
	Times     []float64
	IndexN    []float64 // TODO: may be refactor with buckets ?
	// contains filtered or unexported fields
}

type StatIndexSummary

type StatIndexSummary map[StatKey]*StatIndexNode

func NewStatIndexSummary

func NewStatIndexSummary() StatIndexSummary

func (StatIndexSummary) Aggregate

func (sSum StatIndexSummary) Aggregate() map[LabelKey][]*StatIndexAggNode

func (StatIndexSummary) Append

func (sSum StatIndexSummary) Append(indexKey StatKey, statIndex []StatQuery, s *stat.Stat) *StatIndexNode

type StatKey

type StatKey struct {
	RequestType   string
	Queries       string
	DurationLabel string
	OffsetLabel   string
}

func (*StatKey) Empty

func (k *StatKey) Empty() bool

type StatQuery

type StatQuery struct {
	Query         string
	DurationLabel string
	Offset        string
}

type StatQueryNode

type StatQueryNode struct {
	IndexKey StatKey
	DataKey  StatKey

	Queries []StatQuery

	SampleId string

	ErrorId string

	N           int64
	Errors      int64
	IndexErrors int64
	DataErrors  int64

	IndexCacheHit  int64
	IndexCacheMiss int64

	RequestStatus map[int64]int64
	RequestTimes  []float64
	QueryTimes    []float64

	Metrics []float64
	Points  []float64
	Bytes   []float64

	ReadRows  []float64
	ReadBytes []float64

	DataReadRows  []float64
	DataReadBytes []float64
	DataTimes     []float64

	IndexReadRows  []float64
	IndexReadBytes []float64
	IndexTimes     []float64
	// contains filtered or unexported fields
}

type StatRequestAggNode

type StatRequestAggNode struct {
	IndexKey StatKey
	DataKey  StatKey

	Queries []StatQuery

	SampleId string
	ErrorId  string

	N                 int64
	ErrorsPcnt        float64
	IndexErrorsPcnt   float64
	IndexCacheHitPcnt float64
	DataErrorsPcnt    float64

	RequestStatus map[int64]int64

	Metrics AggNode
	Points  AggNode
	Bytes   AggNode

	ReadRows     AggNode
	ReadBytes    AggNode
	RequestTimes AggNode
	QueryTimes   AggNode

	DataReadRows  AggNode
	DataReadBytes AggNode
	DataTimes     AggNode

	IndexReadRows  AggNode
	IndexReadBytes AggNode
	IndexTimes     AggNode
}

type StatRequestSummary

type StatRequestSummary map[StatKey]*StatQueryNode

func NewStatQuerySummary

func NewStatQuerySummary() StatRequestSummary

func (StatRequestSummary) Aggregate

func (sSum StatRequestSummary) Aggregate() map[LabelKey][]*StatRequestAggNode

func (StatRequestSummary) Append

func (sSum StatRequestSummary) Append(indexKey, dataKey StatKey, statQueries []StatQuery, s *stat.Stat) *StatQueryNode

type StatSummary

type StatSummary struct {
	Index StatIndexSummary
	// DataIndex StatIndexSummary
	Requests StatRequestSummary
}

func NewStatSummary

func NewStatSummary() *StatSummary

func (*StatSummary) Aggregate

func (sSum *StatSummary) Aggregate() *StatAggSum

func (*StatSummary) Append

func (sSum *StatSummary) Append(s *stat.Stat)

Jump to

Keyboard shortcuts

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