metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector implements the MetricsCollectionService interface

func NewCollector

func NewCollector() *Collector

NewCollector creates a new instance of the metrics collector

func (*Collector) CleanupNodeMetrics

func (c *Collector) CleanupNodeMetrics(ctx context.Context, nodeID string) error

CleanupNodeMetrics removes metrics for a node

func (*Collector) Initialize

func (c *Collector) Initialize(ctx context.Context) error

Initialize sets up the metrics collector

func (*Collector) InitializeNodeMetrics

func (c *Collector) InitializeNodeMetrics(ctx context.Context, nodeID string) error

InitializeNodeMetrics initializes metrics collection for a node

func (*Collector) RecordLogProcessing

func (c *Collector) RecordLogProcessing(ctx context.Context, nodeID string, duration time.Duration, logCount int) error

RecordLogProcessing records log processing metrics

func (*Collector) RecordModelLatency

func (c *Collector) RecordModelLatency(ctx context.Context, nodeID string, operation string, duration time.Duration) error

RecordModelLatency records model interaction latency

func (*Collector) RecordNodeStatusChange

func (c *Collector) RecordNodeStatusChange(ctx context.Context, nodeID string, status string) error

RecordNodeStatusChange records a node status change

func (*Collector) RecordRepositoryError

func (c *Collector) RecordRepositoryError(ctx context.Context, nodeID string, operation string, errorType string) error

RecordRepositoryError records repository operation errors

type NodeMetrics

type NodeMetrics struct {
	NodeID        string
	CreatedAt     time.Time
	LastActive    time.Time
	StatusHistory []StatusChange
}

NodeMetrics represents metrics for a specific node

type StatusChange

type StatusChange struct {
	Timestamp time.Time
	Status    string
}

StatusChange represents a node status change event

Jump to

Keyboard shortcuts

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