distributed

package
v0.0.0-...-17e6b21 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedWorker

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

func (*DistributedWorker) StartProcessing

func (dw *DistributedWorker) StartProcessing(
	ctx context.Context,
	subject string,
) error

type NetworkStats

type NetworkStats struct {
	BytesSent     int64
	BytesReceived int64
	Latency       time.Duration
}

type Orchestrator

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

func NewOrchestrator

func NewOrchestrator(
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
	natsConn *nats.Conn,
) *Orchestrator

func (*Orchestrator) RegisterWorker

func (o *Orchestrator) RegisterWorker(
	ctx context.Context,
	worker *Worker,
) error

func (*Orchestrator) SubmitTask

func (o *Orchestrator) SubmitTask(
	ctx context.Context,
	task *Task,
) error

type ResourceUsage

type ResourceUsage struct {
	CPU     float64
	Memory  float64
	Storage float64
	Network NetworkStats
}

type Task

type Task struct {
	ID         string
	Type       string
	Priority   int
	Status     TaskStatus
	AssignedTo string
	StartTime  time.Time
	EndTime    time.Time
	Retries    int
	MaxRetries int
	Data       []byte
}

type TaskProcessor

type TaskProcessor interface {
	Process(context.Context, *Task) (*Result, error)
	GetCapabilities() []string
}

type TaskStatus

type TaskStatus string

type Worker

type Worker struct {
	ID            string
	Capabilities  []string
	Status        WorkerStatus
	LastHeartbeat time.Time
	TaskCount     int
	Metrics       WorkerMetrics
}

type WorkerMetrics

type WorkerMetrics struct {
	CPUUsage    float64
	MemoryUsage float64
	TasksTotal  int64
	ErrorCount  int64
}

type WorkerStatus

type WorkerStatus struct {
	ID            string
	State         string
	ActiveTasks   int
	Capabilities  []string
	LastHeartbeat time.Time
	Resources     ResourceUsage
}

Jump to

Keyboard shortcuts

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