metrics

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheMetricsCollector

type CacheMetricsCollector interface {
	RedisCommand(command string, err error)
}

type Collector

type Collector interface {
	DBQuery(duration time.Duration, err error)
	DBTransaction(err error)
	DBConnections(count int)
	RedisCommand(command string, err error)
	RedisConnections(count int)
	MongoOperation(operation string, err error)
	SearchQuery(engine string, err error)
	SearchIndex(engine, operation string)
	MQPublish(system string, err error)
	MQConsume(system string, err error)
	HealthCheck(component string, healthy bool)
}

type DataCollector

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

func NewDataCollector

func NewDataCollector(batchSize int) *DataCollector

func (*DataCollector) Close

func (c *DataCollector) Close() error

func (*DataCollector) DBConnections

func (c *DataCollector) DBConnections(count int)

func (*DataCollector) DBQuery

func (c *DataCollector) DBQuery(duration time.Duration, err error)

func (*DataCollector) DBTransaction

func (c *DataCollector) DBTransaction(err error)

func (*DataCollector) GetStats

func (c *DataCollector) GetStats() map[string]any

func (*DataCollector) HealthCheck

func (c *DataCollector) HealthCheck(component string, healthy bool)

func (*DataCollector) MQConsume

func (c *DataCollector) MQConsume(system string, err error)

func (*DataCollector) MQPublish

func (c *DataCollector) MQPublish(system string, err error)

func (*DataCollector) MongoOperation

func (c *DataCollector) MongoOperation(operation string, err error)

func (*DataCollector) RedisCommand

func (c *DataCollector) RedisCommand(command string, err error)

func (*DataCollector) RedisConnections

func (c *DataCollector) RedisConnections(count int)

func (*DataCollector) SearchIndex

func (c *DataCollector) SearchIndex(engine, operation string)

func (*DataCollector) SearchQuery

func (c *DataCollector) SearchQuery(engine string, err error)

func (*DataCollector) SetStorage added in v0.2.0

func (c *DataCollector) SetStorage(storage Storage)

type ExtensionCollector

type ExtensionCollector interface {
	DBQuery(duration time.Duration, err error)
	DBTransaction(err error)
	DBConnections(count int)
	RedisCommand(command string, err error)
	RedisConnections(count int)
	MongoOperation(operation string, err error)
	SearchQuery(engine string, err error)
	SearchIndex(engine, operation string)
	MQPublish(system string, err error)
	MQConsume(system string, err error)
	HealthCheck(component string, healthy bool)
}

type ExtensionCollectorAdapter

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

func NewExtensionCollectorAdapter

func NewExtensionCollectorAdapter(collector ExtensionCollector) *ExtensionCollectorAdapter

func (*ExtensionCollectorAdapter) DBConnections

func (a *ExtensionCollectorAdapter) DBConnections(count int)

func (*ExtensionCollectorAdapter) DBQuery

func (a *ExtensionCollectorAdapter) DBQuery(duration time.Duration, err error)

func (*ExtensionCollectorAdapter) DBTransaction

func (a *ExtensionCollectorAdapter) DBTransaction(err error)

func (*ExtensionCollectorAdapter) HealthCheck

func (a *ExtensionCollectorAdapter) HealthCheck(component string, healthy bool)

func (*ExtensionCollectorAdapter) MQConsume

func (a *ExtensionCollectorAdapter) MQConsume(system string, err error)

func (*ExtensionCollectorAdapter) MQPublish

func (a *ExtensionCollectorAdapter) MQPublish(system string, err error)

func (*ExtensionCollectorAdapter) MongoOperation

func (a *ExtensionCollectorAdapter) MongoOperation(operation string, err error)

func (*ExtensionCollectorAdapter) RedisCommand

func (a *ExtensionCollectorAdapter) RedisCommand(command string, err error)

func (*ExtensionCollectorAdapter) RedisConnections

func (a *ExtensionCollectorAdapter) RedisConnections(count int)

func (*ExtensionCollectorAdapter) SearchIndex

func (a *ExtensionCollectorAdapter) SearchIndex(engine, operation string)

func (*ExtensionCollectorAdapter) SearchQuery

func (a *ExtensionCollectorAdapter) SearchQuery(engine string, err error)

type HealthChecker

type HealthChecker interface {
	Check(ctx context.Context) error
	Name() string
}

type HealthMonitor

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

func NewHealthMonitor

func NewHealthMonitor(collector Collector) *HealthMonitor

func (*HealthMonitor) CheckAll

func (h *HealthMonitor) CheckAll(ctx context.Context) map[string]bool

func (*HealthMonitor) CheckComponent

func (h *HealthMonitor) CheckComponent(ctx context.Context, name string) bool

func (*HealthMonitor) RegisterComponent

func (h *HealthMonitor) RegisterComponent(checker HealthChecker)

type Labels

type Labels map[string]string

type MemoryStorage

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

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) Close

func (m *MemoryStorage) Close() error

func (*MemoryStorage) Query

func (m *MemoryStorage) Query(query QueryRequest) ([]Metric, error)

func (*MemoryStorage) Store

func (m *MemoryStorage) Store(metrics []Metric) error

type Metric

type Metric struct {
	Type      string    `json:"type"`
	Value     int64     `json:"value"`
	Labels    Labels    `json:"labels"`
	Timestamp time.Time `json:"timestamp"`
}

type NoOpCollector

type NoOpCollector struct{}

func (NoOpCollector) DBConnections

func (NoOpCollector) DBConnections(int)

func (NoOpCollector) DBQuery

func (NoOpCollector) DBQuery(time.Duration, error)

func (NoOpCollector) DBTransaction

func (NoOpCollector) DBTransaction(error)

func (NoOpCollector) HealthCheck

func (NoOpCollector) HealthCheck(string, bool)

func (NoOpCollector) MQConsume

func (NoOpCollector) MQConsume(string, error)

func (NoOpCollector) MQPublish

func (NoOpCollector) MQPublish(string, error)

func (NoOpCollector) MongoOperation

func (NoOpCollector) MongoOperation(string, error)

func (NoOpCollector) RedisCommand

func (NoOpCollector) RedisCommand(string, error)

func (NoOpCollector) RedisConnections

func (NoOpCollector) RedisConnections(int)

func (NoOpCollector) SearchIndex

func (NoOpCollector) SearchIndex(string, string)

func (NoOpCollector) SearchQuery

func (NoOpCollector) SearchQuery(string, error)

type QueryRequest

type QueryRequest struct {
	Type      string    `json:"type"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
	Labels    Labels    `json:"labels"`
	Limit     int       `json:"limit"`
}

type Storage

type Storage interface {
	Store(metrics []Metric) error
	Query(query QueryRequest) ([]Metric, error)
	Close() error
}

Jump to

Keyboard shortcuts

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