counter

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ACTIVE_SERVICE = "GoActiveService"
View Source
const ACTIVE_SPEED = "ActiveSpeed"
View Source
const ELAPSED_TIME = "GoElapsedTime"
View Source
const ERROR_RATE = "GoErrorRate"
View Source
const GO_CGO_CALL = "GoCgoCall"
View Source
const GO_GC_COUNT = "GoGcCount"
View Source
const GO_GC_PAUSE = "GoGcPause"
View Source
const GO_GOROUTINE = "Goroutine"
View Source
const GO_HEAP_USED = "GoHeapUsed"
View Source
const TPS = "GoTPS"

Variables

This section is empty.

Functions

func SendGoCounter

func SendGoCounter()

func SendServiceCounter

func SendServiceCounter()

func Start

func Start()

Types

type Handler

type Handler interface {
	// contains filtered or unexported methods
}

type Metering

type Metering struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewMetering

func NewMetering(create func() interface{}, clear func(interface{})) *Metering

func (*Metering) GetCurrentBucket

func (m *Metering) GetCurrentBucket() interface{}

func (*Metering) SearchOnHandler

func (m *Metering) SearchOnHandler(period int, handler func(interface{})) int

type ServiceBucket

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

type ServiceCounter

type ServiceCounter struct {
	Tps       float32
	Elapsed   int
	ErrorRate float32
}

type ServiceMetering

type ServiceMetering struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func GetServiceMeter

func GetServiceMeter() *ServiceMetering

func (*ServiceMetering) Add

func (g *ServiceMetering) Add(elapsed int, err bool)

func (*ServiceMetering) GetAllCounter

func (g *ServiceMetering) GetAllCounter(period int) *ServiceCounter

type ValueBucket

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

type ValueMetering

type ValueMetering struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewValueMeter

func NewValueMeter() *ValueMetering

func (*ValueMetering) Add

func (g *ValueMetering) Add(value float64)

func (*ValueMetering) GetAllCounter

func (g *ValueMetering) GetAllCounter(period int) *ValueMetric

type ValueMetric

type ValueMetric struct {
	Sum float64
	Avg float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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