Documentation ¶
Overview ¶
Package stats used to record pl metrics
Index ¶
- func InitLog()
- func SetStats(st Stats)
- func WriteEvent(event *ChangeEvent, tags map[string]string)
- func WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)
- func WriteUpdateTime(tags map[string]string)
- type ChangeEvent
- type EventOP
- type RecEvent
- type RecMetric
- type RecStats
- func (stats *RecStats) Metrics() []prometheus.Collector
- func (stats *RecStats) ReadEvents(events []*ChangeEvent) []*ChangeEvent
- func (stats *RecStats) WriteEvent(event *ChangeEvent, tags map[string]string)
- func (stats *RecStats) WriteMetric(tags map[string]string, pt, ptDrop, ptError float64, cost time.Duration)
- func (stats *RecStats) WriteUpdateTime(tags map[string]string)
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteEvent ¶
func WriteEvent(event *ChangeEvent, tags map[string]string)
func WriteMetric ¶ added in v1.1.12
func WriteUpdateTime ¶ added in v1.1.12
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
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 (*RecMetric) WriteUpdateTime ¶ added in v1.1.12
type RecStats ¶ added in v1.1.12
type RecStats struct {
// contains filtered or unexported fields
}
func NewRecStats ¶ added in v1.1.12
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 (*RecStats) WriteUpdateTime ¶ added in v1.1.12
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) }
Click to show internal directories.
Click to hide internal directories.