dostats

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

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdStats = map[CmdType]*docalOpStats{
	CmdServer: &docalOpStats{
		opmap: make(map[string]*OpStats, 64),
	},
}

Functions

func ConnsAlive

func ConnsAlive() int64

func ConnsTotal

func ConnsTotal() int64

func DecrConns

func DecrConns()

func GetMemUsage

func GetMemUsage() *runtime.MemStats

func GetPoolActive

func GetPoolActive() int

func IncrConns

func IncrConns() int64

func IncrOpStats

func IncrOpStats(ct CmdType, e *OpStats)

func IncrOpTotal

func IncrOpTotal(ct CmdType, n int64)

func OpFails

func OpFails(ct CmdType) int64

func OpPeriodFails

func OpPeriodFails(ct CmdType) int64

func OpQPS

func OpQPS(ct CmdType) int64

func OpTotal

func OpTotal(ct CmdType) int64

func PeriodResetStats

func PeriodResetStats()

func ResetStats

func ResetStats()

func SetPoolActive

func SetPoolActive(n int)

func SetPoolStat

func SetPoolStat(activeCount int, idleCount int)

Types

type CalDoStats

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

func NewCalDoStats

func NewCalDoStats() *CalDoStats

func (*CalDoStats) FlushOpStats

func (s *CalDoStats) FlushOpStats(ct CmdType)

func (*CalDoStats) IncrOpFails

func (s *CalDoStats) IncrOpFails(opstr string, err error) error

func (*CalDoStats) IncrOpStats

func (s *CalDoStats) IncrOpStats(opstr string, startUnixNano int64)

func (*CalDoStats) IncrOpTotal

func (s *CalDoStats) IncrOpTotal()

type CalOpStats

type CalOpStats struct {
	OpStr        string `json:"opstr"`
	Calls        int64  `json:"calls"`
	Usecs        int64  `json:"usecs"`
	UsecsPercall int64  `json:"usecs_percall"`
	Fails        int64  `json:"fails"`
	PeriodFails  int64  `json:"periodfails"`
}

func GetOpStatsAll

func GetOpStatsAll(ct CmdType) ([]*CalOpStats, error)

type CmdType

type CmdType string
const (
	CmdServer CmdType = "cmd_proxy"
)

type OpStats

type OpStats struct {
	Opstr       string
	Calls       atomic.Int64
	Nsecs       atomic.Int64
	Fails       atomic.Int64
	PeriodFails atomic.Int64
}

func (*OpStats) OpStats

func (s *OpStats) OpStats() *CalOpStats

type PoolStat

type PoolStat struct {
	ActiveCount int `json:"active_count"`
	IdleCount   int `json:"idle_count"`
}

func GetPoolStat

func GetPoolStat() PoolStat

type SysUsage

type SysUsage struct {
	Now time.Time
	CPU float64
	*utils.Usage
}

func GetSysUsage

func GetSysUsage() *SysUsage

Jump to

Keyboard shortcuts

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