statsd

package
v0.0.0-...-8d187f3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiTypeToName = map[ApiType]string{
	Sync:                   "Sync",
	AnalyzerSync:           "AnalyzerSync",
	Upgrade:                "Upgrade",
	Query:                  "Query",
	GetKubernetesClusterID: "GetKubernetesClusterID",
	GenesisSync:            "GenesisSync",
	KubernetesAPISync:      "KubernetesAPISync",
	PrometheusAPISync:      "PrometheusAPISync",
	GetPrometheusLabelIDs:  "GetPrometheusLabelIDs",
	GetPrometheusTargets:   "GetPrometheusTargets",
	GPIDSync:               "GPIDSync",
}

Functions

func AddGPIDReceiveCounter

func AddGPIDReceiveCounter(count uint64)

func AddGPIDSendCounter

func AddGPIDSendCounter(count uint64)

func AddGrpcCostStatsd

func AddGrpcCostStatsd(apiType ApiType, cost int)

func Start

func Start()

Types

type ApiType

type ApiType int
const (
	Sync ApiType = iota
	AnalyzerSync
	Upgrade
	Query
	GetKubernetesClusterID
	GenesisSync
	KubernetesAPISync
	PrometheusAPISync
	GPIDSync
	GetPrometheusLabelIDs
	GetPrometheusTargets
	MaxApiType
)

type Counter

type Counter struct {
	ReqCount uint64 `statsd:"req_count"`
	AvgDelay uint64 `statsd:"avg_delay"`
	MaxDelay uint64 `statsd:"max_delay"`
	SumDelay uint64
}

func (*Counter) AddCostTime

func (c *Counter) AddCostTime(cost uint64)

type GCounter

type GCounter struct {
	Receive uint64 `statsd:"receive_count"`
	Send    uint64 `statsd:"send_count"`
}

func (*GCounter) AddReceiveCount

func (c *GCounter) AddReceiveCount(count uint64)

func (*GCounter) AddSendCount

func (c *GCounter) AddSendCount(count uint64)

type GPIDCounter

type GPIDCounter struct {
	*GCounter
}

func NewGPIDCounter

func NewGPIDCounter() *GPIDCounter

func (*GPIDCounter) Closed

func (g *GPIDCounter) Closed() bool

func (*GPIDCounter) GetCounter

func (g *GPIDCounter) GetCounter() interface{}

type GetPrometheusLabelIDsCounter

type GetPrometheusLabelIDsCounter struct {
	*PrometheusLabelIDsCounter
}

func GetPrometheusLabelIDsCounterSingleton

func GetPrometheusLabelIDsCounterSingleton() *GetPrometheusLabelIDsCounter

func NewGetPrometheusLabelIDsCounter

func NewGetPrometheusLabelIDsCounter() *GetPrometheusLabelIDsCounter

func (*GetPrometheusLabelIDsCounter) Closed

func (g *GetPrometheusLabelIDsCounter) Closed() bool

func (*GetPrometheusLabelIDsCounter) GetCounter

func (g *GetPrometheusLabelIDsCounter) GetCounter() interface{}

type GrpcCounter

type GrpcCounter struct {
	*Counter
}

func NewGrpcCounter

func NewGrpcCounter() *GrpcCounter

func (*GrpcCounter) Closed

func (g *GrpcCounter) Closed() bool

func (*GrpcCounter) GetCounter

func (g *GrpcCounter) GetCounter() interface{}

type PrometheusLabelIDsCounter

type PrometheusLabelIDsCounter struct {
	ReceiveMetricCount uint64 `statsd:"receive_metric_count"`
	ReceiveLabelCount  uint64 `statsd:"receive_label_count"`
	ReceiveTargetCount uint64 `statsd:"receive_target_count"`
	SendMetricCount    uint64 `statsd:"send_metric_count"`
	SendLabelCount     uint64 `statsd:"send_label_count"`
	SendTargetCount    uint64 `statsd:"send_target_count"`
}

func NewPrometheusLabelIDsCounter

func NewPrometheusLabelIDsCounter() *PrometheusLabelIDsCounter

func (*PrometheusLabelIDsCounter) Fill

type VTapCounter

type VTapCounter struct {
	ORGIDToVTapNameCounter map[int]VTapNameCounter
	// contains filtered or unexported fields
}

func GetVTapCounter

func GetVTapCounter() *VTapCounter

func (*VTapCounter) GetVtapNameCounter

func (c *VTapCounter) GetVtapNameCounter(orgID int) VTapNameCounter

func (*VTapCounter) SetCounter

func (c *VTapCounter) SetCounter(db *mysql.DB, teamID int, vtapName string, weight float64, isChanged uint64)

func (*VTapCounter) SetNull

func (c *VTapCounter) SetNull(orgID int, vtapName string)

type VTapNameCounter

type VTapNameCounter map[string]*VTapWeightCounter

type VTapWeightCounter

type VTapWeightCounter struct {
	ORGID             uint16
	TeamID            uint16
	Name              string
	Weight            float64
	IsAnalyzerChanged uint64
}

func NewVTapWeightCounter

func NewVTapWeightCounter() *VTapWeightCounter

func (*VTapWeightCounter) SendStats

func (v *VTapWeightCounter) SendStats(vtapName string)

Jump to

Keyboard shortcuts

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