telemetry

package
v0.0.0-...-3dfe9a2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Configuration Errors
	ErrInvalidConfig = errors.ErrorCode("telemetry_invalid_config")
	ErrInvalidDBPath = errors.ErrorCode("telemetry_invalid_db_path")

	// Collection Errors
	ErrMetricsCollection = errors.ErrorCode("telemetry_metrics_collection_failed")
	ErrInvalidMetrics    = errors.ErrorCode("telemetry_invalid_metrics")

	// Storage Errors
	ErrStorageAccess    = errors.ErrorCode("telemetry_storage_access_failed")
	ErrStorageInit      = errors.ErrorCode("telemetry_storage_init_failed")
	ErrStorageClose     = errors.ErrorCode("telemetry_storage_close_failed")
	ErrSchemaInitFailed = errors.ErrorCode("telemetry_schema_init_failed")

	// Operation Errors
	ErrOperationTimeout = errors.ErrorCode("telemetry_operation_timeout")
	ErrServiceShutdown  = errors.ErrorCode("telemetry_service_shutdown_failed")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Record(ctx context.Context, snapshot *MetricsSnapshot) error
	Close() error
}

Collector defines the core domain interface

func NewService

func NewService(cfg Config) (Collector, error)

type Config

type Config struct {
	DBPath string
}

func DefaultConfig

func DefaultConfig() Config

func (Config) Validate

func (c Config) Validate() error

type FanMetrics

type FanMetrics struct {
	Current int
	Target  int
}

Domain value objects

type MetricsSnapshot

type MetricsSnapshot struct {
	Timestamp   time.Time
	FanSpeed    FanMetrics
	Temperature TempMetrics
	PowerLimit  PowerMetrics
	SystemState StateMetrics
}

MetricsSnapshot represents domain entities

type PowerMetrics

type PowerMetrics struct {
	Current int
	Target  int
	Average float64
}

type Repository

type Repository interface {
	Store(ctx context.Context, snapshot *MetricsSnapshot) error
	Close() error
}

func NewRepository

func NewRepository(cfg Config) (Repository, error)

type StateMetrics

type StateMetrics struct {
	AutoFanControl  bool
	PerformanceMode bool
}

type TempMetrics

type TempMetrics struct {
	Current float64
	Average float64
}

Jump to

Keyboard shortcuts

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