stats

package
v0.0.0-...-406c194 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Name  string `json:"name"`
	Value int64  `json:"value"`
}

func NewCounter

func NewCounter(name string, value int64) *Counter

func (*Counter) Incr

func (d *Counter) Incr(v int64)

func (*Counter) Val

func (d *Counter) Val() int64

type CounterStat

type CounterStat struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCounterStat

func NewCounterStat() *CounterStat

func (*CounterStat) GetTopValues

func (c *CounterStat) GetTopValues(count int) []Counter

func (*CounterStat) GetValue

func (c *CounterStat) GetValue(name string) int64

func (*CounterStat) Incr

func (c *CounterStat) Incr(name string, v int64)

func (*CounterStat) MapValues

func (c *CounterStat) MapValues() map[string]int64

func (*CounterStat) Values

func (c *CounterStat) Values() []Counter

type DayDnsStat

type DayDnsStat struct {
	sync.RWMutex
	LastRolling   time.Time
	CycleInterval time.Duration
	Values        map[int64]map[string]int64
}

func NewDayDnsStat

func NewDayDnsStat(ival time.Duration) *DayDnsStat

func (*DayDnsStat) LineChartData

func (d *DayDnsStat) LineChartData(name string) *LineChartData

func (*DayDnsStat) Rolling

func (d *DayDnsStat) Rolling()

Rolling 滚动清除老数据

func (*DayDnsStat) Update

func (d *DayDnsStat) Update(c *CounterStat)

type LineChartData

type LineChartData struct {
	Title     string                `json:"title"`
	YaxisName string                `json:"yaxis_name"`
	Datas     map[string][][2]int64 `json:"datas"`
}

func NewLineChartData

func NewLineChartData(title string, yaxisName string) *LineChartData

func (*LineChartData) ChartData

func (l *LineChartData) ChartData(intervalSec int64) *LineChartData

func (*LineChartData) QpsData

func (l *LineChartData) QpsData(intervalSec int64) *LineChartData

type Metrics

type Metrics struct {
	Icon  string
	Value interface{}
	Title string
}

func NewMetrics

func NewMetrics(icon string, value interface{}, title string) *Metrics

Jump to

Keyboard shortcuts

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