prome

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: GPL-3.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	StatusOK int8 = iota
	StatusERR
	StatusMax
)
View Source
const (
	MetricsChannelBuff        = 30000
	MetricsCollectInterval    = 30
	MetricsGatherDBBuffSize   = 300
	MetricsCostBucketSize     = 100
	MetricsCostBucketMaxValue = 200
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	ServerExporter
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(namespace string) *Exporter

func (*Exporter) Close

func (exporter *Exporter) Close()

func (*Exporter) Collect

func (exporter *Exporter) Collect(ch chan<- prometheus.Metric)

Implements prometheus.Collector.

func (*Exporter) Describe

func (exporter *Exporter) Describe(ch chan<- *prometheus.Desc)

Implements prometheus.Collector.

func (*Exporter) Start

func (exporter *Exporter) Start(port int) error

type MetricsGather

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

type MetricsInfo

type MetricsInfo struct {
	Name       string             `json:"name"`
	Status     string             `json:"status"`
	QPS        float32            `json:"qps"`
	Total      int                `json:"total"`
	AvgCost    float64            `json:"avg_cost"`
	MaxCost    float64            `json:"max_cost"`
	AvgCounter float32            `json:"avg_counter"`
	Counter    float32            `json:"counter"`
	CostBucket map[float64]uint64 `json:"-"`
}

func (*MetricsInfo) String

func (info *MetricsInfo) String() string

type MetricsInstance

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

func (*MetricsInstance) AddItem

func (mInstance *MetricsInstance) AddItem(mi *MetricsItem)

func (*MetricsInstance) GetMetricsInfo

func (mInstance *MetricsInstance) GetMetricsInfo() []MetricsInfo

type MetricsItem

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

func NewCounterStat

func NewCounterStat(name string, counter int) *MetricsItem

func NewStat

func NewStat(name string) *MetricsItem

func (*MetricsItem) End

func (mi *MetricsItem) End()

func (*MetricsItem) MarkErr

func (mi *MetricsItem) MarkErr() *MetricsItem

func (*MetricsItem) MarkOk

func (mi *MetricsItem) MarkOk() *MetricsItem

func (*MetricsItem) SampleRate

func (mi *MetricsItem) SampleRate(rate float32) *MetricsItem

func (*MetricsItem) SetCounter

func (mi *MetricsItem) SetCounter(counter int) *MetricsItem

type ServerExporter

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

func NewServerExporter

func NewServerExporter(namespace string) *ServerExporter

func (*ServerExporter) Describe

func (serverE *ServerExporter) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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