Documentation ¶
Index ¶
- Constants
- Variables
- type ConnectionStatManager
- type DefaultStatManager
- func (sm *DefaultStatManager) Clean(_ string)
- func (sm *DefaultStatManager) GetMetrics() []any
- func (sm *DefaultStatManager) IncTotalExceptions(err string)
- func (sm *DefaultStatManager) IncTotalMessagesProcessed(n int64)
- func (sm *DefaultStatManager) IncTotalRecordsIn()
- func (sm *DefaultStatManager) IncTotalRecordsOut()
- func (sm *DefaultStatManager) ProcessTimeEnd()
- func (sm *DefaultStatManager) ProcessTimeStart()
- func (sm *DefaultStatManager) SetBufferLength(l int64)
- func (sm *DefaultStatManager) SetConnectionState(status string, message string)
- func (sm *DefaultStatManager) SetProcessTimeStart(t time.Time)
- type MetricGroup
- type PrometheusMetrics
- type PrometheusStatManager
- func (sm *PrometheusStatManager) Clean(ruleId string)
- func (sm *PrometheusStatManager) IncTotalExceptions(err string)
- func (sm *PrometheusStatManager) IncTotalMessagesProcessed(n int64)
- func (sm *PrometheusStatManager) IncTotalRecordsIn()
- func (sm *PrometheusStatManager) IncTotalRecordsOut()
- func (sm *PrometheusStatManager) ProcessTimeEnd()
- func (sm *PrometheusStatManager) SetBufferLength(l int64)
- func (sm *PrometheusStatManager) SetConnectionState(state string, message string)
- type StatManager
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" ConnectionStatus = "connection_status" ConnectionLastConnectedTime = "connection_last_connected_time" ConnectionLastDisconnectedTime = "connection_last_disconnected_time" ConnectionLastDisconnectedMessage = "connection_last_disconnected_message" ConnectionLastTryTime = "connection_last_try_time" )
Variables ¶
View Source
var MetricNames = []string{RecordsInTotal, RecordsOutTotal, MessagesProcessedTotal, ProcessLatencyUs, BufferLength, LastInvocation, ExceptionsTotal, LastException, LastExceptionTime, ConnectionStatus, ConnectionLastConnectedTime, ConnectionLastDisconnectedTime, ConnectionLastDisconnectedMessage, ConnectionLastTryTime}
Functions ¶
This section is empty.
Types ¶
type ConnectionStatManager ¶
type ConnectionStatManager struct {
// contains filtered or unexported fields
}
func (*ConnectionStatManager) SetConnectionState ¶
func (csm *ConnectionStatManager) SetConnectionState(state string, message string)
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) SetConnectionState ¶
func (sm *DefaultStatManager) SetConnectionState(status string, message string)
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 ConnectionStatus *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)
func (*PrometheusStatManager) SetConnectionState ¶
func (sm *PrometheusStatManager) SetConnectionState(state string, message string)
type StatManager ¶
type StatManager interface { IncTotalRecordsIn() IncTotalRecordsOut() IncTotalMessagesProcessed(n int64) IncTotalExceptions(err string) ProcessTimeStart() ProcessTimeEnd() SetBufferLength(l int64) SetProcessTimeStart(t time.Time) // 0 is connecting, 1 is connected, -1 is disconnected SetConnectionState(state string, message string) GetMetrics() []any // Clean remove all metrics history Clean(ruleId string) }
func NewStatManager ¶
func NewStatManager(ctx api.StreamContext, opType string) StatManager
Click to show internal directories.
Click to hide internal directories.