stats

package
v0.0.0-...-9750751 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActiveCreate = iota
	ActiveGet
	ActiveUpdate
	ActiveSet
	ActiveDestroy
	ActiveUDFGet
	ActiveUDFSet
	NumErrors
	LastCounter // insert new counter before this
)

counters

View Source
const (
	KTypeManager          = Type(1)
	KTypeMonitor          = Type(2)
	KTypeWorker           = Type(3)
	KTypeStandAloneWorker = Type(4)
)

Variables

View Source
var (
	HttpServerMux http.ServeMux
)

Functions

func AddState

func AddState(st stats.IState, append bool)

func Enabled

func Enabled() bool

func Finalize

func Finalize()

func FinalizeForMonitor

func FinalizeForMonitor()

func GetActiveCreateCounter

func GetActiveCreateCounter() *util.AtomicCounter

func GetActiveDestroyCounter

func GetActiveDestroyCounter() *util.AtomicCounter

func GetActiveGetCounter

func GetActiveGetCounter() *util.AtomicCounter

func GetActiveSetCounter

func GetActiveSetCounter() *util.AtomicCounter

func GetActiveUDFGetCounter

func GetActiveUDFGetCounter() *util.AtomicCounter

func GetActiveUDFSetCounter

func GetActiveUDFSetCounter() *util.AtomicCounter

func GetActiveUpdateCounter

func GetActiveUpdateCounter() *util.AtomicCounter

func GetThroughputEmaErrorRate

func GetThroughputEmaErrorRate() (tps uint32, ema uint32, eps uint32)

func Init

func Init(id int32, logfilepath string)

func InitMachCpuUsage

func InitMachCpuUsage()

func InitProcCpuUsage

func InitProcCpuUsage()

func Initialize

func Initialize(args ...interface{}) (err error)

Arguments arg 0: Type stats.Type arg 1: WorkerId int, if Type == KTypeWorker

func InitializeForMonitor

func InitializeForMonitor(args ...interface{}) (err error)

func MachCpuUsage

func MachCpuUsage() (usage float32)

func ProcCpuUsage

func ProcCpuUsage() (usage float32)

func Quit

func Quit()

func RunCollector

func RunCollector()

func RunMonitorLogger

func RunMonitorLogger()

func SendProcState

func SendProcState(st stats.ProcStat)

func SetListeners

func SetListeners(lsnrs []io.IListener)

func SetRepStatsCallBack

func SetRepStatsCallBack(cb IShmStatsWriterCallBack)

Types

type HandlerForMonitor

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

func (*HandlerForMonitor) GetNumWorkers

func (h *HandlerForMonitor) GetNumWorkers() int

func (*HandlerForMonitor) GetWorkerUrl

func (h *HandlerForMonitor) GetWorkerUrl(i int) string

func (*HandlerForMonitor) Init

func (h *HandlerForMonitor) Init(isChild bool, addrs []string)

func (*HandlerForMonitor) ListenAndServe

func (h *HandlerForMonitor) ListenAndServe(addr string) error

type IShmStatsWriterCallBack

type IShmStatsWriterCallBack interface {
	Call()
}

type StateLog

type StateLog struct {
	stats.StateLog
	// contains filtered or unexported fields
}

func (*StateLog) ProcessStateChange

func (l *StateLog) ProcessStateChange(stat stats.ProcStat)

collect stats

func (*StateLog) ProcessWrite

func (l *StateLog) ProcessWrite(cnt int)

called before write to the state log file

type Type

type Type int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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