metric

package
v1.14.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecordsInTotal         = "records_in_total"
	RecordsOutTotal        = "records_out_total"
	MessagesProcessedTotal = "messages_processed_total"
	ProcessLatencyUs       = "process_latency_us"
	ProcessLatencyUsHist   = "process_latency_us_hist"
	LastInvocation         = "last_invocation"
	BufferLength           = "buffer_length"
	ExceptionsTotal        = "exceptions_total"
	LastException          = "last_exception"
	LastExceptionTime      = "last_exception_time"
)

Variables

Functions

This section is empty.

Types

type DefaultStatManager

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

DefaultStatManager The statManager is not thread safe. Make sure it is used in only one instance

func (*DefaultStatManager) Clean

func (sm *DefaultStatManager) Clean(_ string)

func (*DefaultStatManager) GetMetrics

func (sm *DefaultStatManager) GetMetrics() []any

func (*DefaultStatManager) IncTotalExceptions

func (sm *DefaultStatManager) IncTotalExceptions(err string)

func (*DefaultStatManager) IncTotalMessagesProcessed

func (sm *DefaultStatManager) IncTotalMessagesProcessed(n int64)

func (*DefaultStatManager) IncTotalRecordsIn

func (sm *DefaultStatManager) IncTotalRecordsIn()

func (*DefaultStatManager) IncTotalRecordsOut

func (sm *DefaultStatManager) IncTotalRecordsOut()

func (*DefaultStatManager) ProcessTimeEnd

func (sm *DefaultStatManager) ProcessTimeEnd()

func (*DefaultStatManager) ProcessTimeStart

func (sm *DefaultStatManager) ProcessTimeStart()

func (*DefaultStatManager) SetBufferLength

func (sm *DefaultStatManager) SetBufferLength(l int64)

func (*DefaultStatManager) SetProcessTimeStart

func (sm *DefaultStatManager) SetProcessTimeStart(t time.Time)

type MetricGroup

type MetricGroup struct {
	TotalRecordsIn         *prometheus.CounterVec
	TotalRecordsOut        *prometheus.CounterVec
	TotalMessagesProcessed *prometheus.CounterVec
	TotalExceptions        *prometheus.CounterVec
	ProcessLatencyHist     *prometheus.HistogramVec
	ProcessLatency         *prometheus.GaugeVec
	BufferLength           *prometheus.GaugeVec
}

type PrometheusMetrics

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

func GetPrometheusMetrics

func GetPrometheusMetrics() *PrometheusMetrics

func (*PrometheusMetrics) GetMetricsGroup

func (m *PrometheusMetrics) GetMetricsGroup(opType string) *MetricGroup

type PrometheusStatManager

type PrometheusStatManager struct {
	DefaultStatManager
	// contains filtered or unexported fields
}

func (*PrometheusStatManager) Clean

func (sm *PrometheusStatManager) Clean(ruleId string)

func (*PrometheusStatManager) IncTotalExceptions

func (sm *PrometheusStatManager) IncTotalExceptions(err string)

func (*PrometheusStatManager) IncTotalMessagesProcessed

func (sm *PrometheusStatManager) IncTotalMessagesProcessed(n int64)

func (*PrometheusStatManager) IncTotalRecordsIn

func (sm *PrometheusStatManager) IncTotalRecordsIn()

func (*PrometheusStatManager) IncTotalRecordsOut

func (sm *PrometheusStatManager) IncTotalRecordsOut()

func (*PrometheusStatManager) ProcessTimeEnd

func (sm *PrometheusStatManager) ProcessTimeEnd()

func (*PrometheusStatManager) SetBufferLength

func (sm *PrometheusStatManager) SetBufferLength(l int64)

type StatManager

type StatManager interface {
	IncTotalRecordsIn()
	IncTotalRecordsOut()
	IncTotalMessagesProcessed(n int64)
	IncTotalExceptions(err string)
	ProcessTimeStart()
	ProcessTimeEnd()
	SetBufferLength(l int64)
	SetProcessTimeStart(t time.Time)
	GetMetrics() []any
	// Clean remove all metrics history
	Clean(ruleId string)
}

func NewStatManager

func NewStatManager(ctx api.StreamContext, opType string) StatManager

Jump to

Keyboard shortcuts

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