stat

package
v0.0.0-...-5c7ffcf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var V_0_1 = []int64{0, 1}
View Source
var V_1 = []int64{1}
View Source
var V_1_0 = []int64{1, 0}
View Source
var V_1_1 = []int64{1, 1}

Functions

func SetupStat

func SetupStat()

Types

type Adder

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

func (*Adder) Add

func (a *Adder) Add(keys []string, values []int64)

func (*Adder) Bind

func (a *Adder) Bind(keys ...string) *Bind

keys本身必须不能包含','

type Bind

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

func (*Bind) Add

func (b *Bind) Add(values ...int64)

type CounterItem

type CounterItem struct {
	Name string
	Data map[string][]int64
}

type GaugeItem

type GaugeItem struct {
	Name     string
	SubItems []GaugeSubItem
}

type GaugeSubItem

type GaugeSubItem struct {
	Keys   []string
	Values []int64
}

type Gauger

type Gauger func() []GaugeSubItem

type Logger

type Logger func(string)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var DefaultManager *Manager
var DefaultManager1S *Manager

func NewStatManager

func NewStatManager(intervalSecond int, printer Printer) *Manager

func (*Manager) Counter

func (m *Manager) Counter(name string) *Adder

func (*Manager) Gauge

func (m *Manager) Gauge(name string, gauger Gauger) bool

func (*Manager) IsStopped

func (m *Manager) IsStopped() bool

func (*Manager) Start

func (m *Manager) Start()

func (*Manager) Stop

func (m *Manager) Stop()

type Printer

type Printer interface {
	Print(st StatEvent)
}

type StatEvent

type StatEvent struct {
	Period       time.Time
	Now          time.Time
	CounterItems []CounterItem
	GaugeItems   []GaugeItem
}

Jump to

Keyboard shortcuts

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