stat

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatSlotOrder = 1000
	ResultPass    = "pass"
	ResultBlock   = "block"
)
View Source
const (
	PrepareSlotOrder = 1000
)

Variables

View Source
var (
	DefaultResourceNodePrepareSlot = &ResourceNodePrepareSlot{}
)
View Source
var (
	DefaultSlot = &Slot{}
)

Functions

func ResetResourceNodeMap

func ResetResourceNodeMap()

Types

type BaseStatNode

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

func NewBaseStatNode

func NewBaseStatNode(sampleCount uint32, intervalInMs uint32) *BaseStatNode

func (*BaseStatNode) AddCount

func (n *BaseStatNode) AddCount(event base.MetricEvent, count int64)

func (*BaseStatNode) AvgRT

func (n *BaseStatNode) AvgRT() float64

func (*BaseStatNode) CurrentConcurrency

func (n *BaseStatNode) CurrentConcurrency() int32

func (*BaseStatNode) DecreaseConcurrency

func (n *BaseStatNode) DecreaseConcurrency()

func (*BaseStatNode) DefaultMetric

func (n *BaseStatNode) DefaultMetric() base.ReadStat

func (*BaseStatNode) GenerateReadStat

func (n *BaseStatNode) GenerateReadStat(sampleCount uint32, intervalInMs uint32) (base.ReadStat, error)

func (*BaseStatNode) GetMaxAvg

func (n *BaseStatNode) GetMaxAvg(event base.MetricEvent) float64

func (*BaseStatNode) GetPreviousQPS

func (n *BaseStatNode) GetPreviousQPS(event base.MetricEvent) float64

func (*BaseStatNode) GetQPS

func (n *BaseStatNode) GetQPS(event base.MetricEvent) float64

func (*BaseStatNode) GetSum

func (n *BaseStatNode) GetSum(event base.MetricEvent) int64

func (*BaseStatNode) IncreaseConcurrency

func (n *BaseStatNode) IncreaseConcurrency()

func (*BaseStatNode) MaxConcurrency

func (n *BaseStatNode) MaxConcurrency() int32

func (*BaseStatNode) MetricsOnCondition

func (n *BaseStatNode) MetricsOnCondition(predicate base.TimePredicate) []*base.MetricItem

func (*BaseStatNode) MinRT

func (n *BaseStatNode) MinRT() float64

func (*BaseStatNode) UpdateConcurrency

func (n *BaseStatNode) UpdateConcurrency(concurrency int32)

type ResourceNode

type ResourceNode struct {
	BaseStatNode
	// contains filtered or unexported fields
}

func GetOrCreateResourceNode

func GetOrCreateResourceNode(resource string, resourceType base.ResourceType) *ResourceNode

func GetResourceNode

func GetResourceNode(resource string) *ResourceNode

func InboundNode

func InboundNode() *ResourceNode

InboundNode returns the global inbound statistic node.

func NewResourceNode

func NewResourceNode(resourceName string, resourceType base.ResourceType) *ResourceNode

NewResourceNode creates a new resource node with given name and classification.

func ResourceNodeList

func ResourceNodeList() []*ResourceNode

ResourceNodeList returns the slice of all existing resource nodes.

func (*ResourceNode) ResourceName

func (n *ResourceNode) ResourceName() string

func (*ResourceNode) ResourceType

func (n *ResourceNode) ResourceType() base.ResourceType

type ResourceNodeMap

type ResourceNodeMap map[string]*ResourceNode

type ResourceNodePrepareSlot

type ResourceNodePrepareSlot struct {
}

func (*ResourceNodePrepareSlot) Order

func (s *ResourceNodePrepareSlot) Order() uint32

func (*ResourceNodePrepareSlot) Prepare

func (s *ResourceNodePrepareSlot) Prepare(ctx *base.EntryContext)

type Slot

type Slot struct {
}

func (*Slot) OnCompleted

func (s *Slot) OnCompleted(ctx *base.EntryContext)

func (*Slot) OnEntryBlocked

func (s *Slot) OnEntryBlocked(ctx *base.EntryContext, blockError *base.BlockError)

func (*Slot) OnEntryPassed

func (s *Slot) OnEntryPassed(ctx *base.EntryContext)

func (*Slot) Order

func (s *Slot) Order() uint32

Directories

Path Synopsis
Package stat/base provides fundamental data structures of statistics.
Package stat/base provides fundamental data structures of statistics.

Jump to

Keyboard shortcuts

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