stats

package
v1.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package stats used to record pl metrics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog()

func SetStats added in v1.1.12

func SetStats(st Stats)

func WriteEvent

func WriteEvent(event *ChangeEvent, tags map[string]string)

func WriteMetric added in v1.1.12

func WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)

func WriteUpdateTime added in v1.1.12

func WriteUpdateTime(tags map[string]string)

Types

type ChangeEvent

type ChangeEvent struct {
	Name              string
	Category          point.Category
	NS, NSOld         string
	Script, ScriptOld string

	Op EventOP //

	CompileError string
	Time         time.Time
	// contains filtered or unexported fields
}

func (ChangeEvent) String

func (event ChangeEvent) String() string

type EventOP

type EventOP string
const (
	StatsTimeFormat = "2006-01-02T15:04:05.999Z07:00"

	EventOpAdd                EventOP = "ADD"
	EventOpUpdate             EventOP = "UPDATE"
	EventOpDelete             EventOP = "DELETE"
	EventOpIndex              EventOP = "INDEX"
	EventOpIndexUpdate        EventOP = "INDEX_UPDATE"
	EventOpIndexDelete        EventOP = "INDEX_DELETE"
	EventOpIndexDeleteAndBack EventOP = "INDEX_DELETE_AND_BACK"
	EventOpCompileError       EventOP = "COMPILE_ERROR"

	DefaultSubSystem = "pipeline"
)

type RecEvent added in v1.1.12

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

func (*RecEvent) Read added in v1.1.12

func (event *RecEvent) Read(events []*ChangeEvent) []*ChangeEvent

func (*RecEvent) ReadChan added in v1.1.12

func (event *RecEvent) ReadChan() <-chan *ChangeEvent

func (*RecEvent) Write added in v1.1.12

func (event *RecEvent) Write(change *ChangeEvent, tags map[string]string)

type RecMetric added in v1.1.12

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

func (*RecMetric) Metrics added in v1.1.12

func (rec *RecMetric) Metrics() []prometheus.Collector

func (*RecMetric) WriteMetric added in v1.1.12

func (rec *RecMetric) WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)

func (*RecMetric) WriteUpdateTime added in v1.1.12

func (rec *RecMetric) WriteUpdateTime(tags map[string]string)

type RecStats added in v1.1.12

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

func NewRecStats added in v1.1.12

func NewRecStats(ns, subsystem string, labelNames []string, eventSize int) *RecStats

func (*RecStats) Metrics added in v1.1.12

func (stats *RecStats) Metrics() []prometheus.Collector

func (*RecStats) ReadEvents added in v1.1.12

func (stats *RecStats) ReadEvents(events []*ChangeEvent) []*ChangeEvent

func (*RecStats) WriteEvent added in v1.1.12

func (stats *RecStats) WriteEvent(event *ChangeEvent, tags map[string]string)

func (*RecStats) WriteMetric added in v1.1.12

func (stats *RecStats) WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)

func (*RecStats) WriteUpdateTime added in v1.1.12

func (stats *RecStats) WriteUpdateTime(tags map[string]string)

type Stats

type Stats interface {
	Metrics() []prometheus.Collector
	WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)

	WriteEvent(event *ChangeEvent, tags map[string]string)
	ReadEvents(events []*ChangeEvent) []*ChangeEvent

	WriteUpdateTime(tags map[string]string)
}

Jump to

Keyboard shortcuts

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