config

package
v1.0.0-beta.162 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config provides configuration for SemStreams E2E tests

Package config provides configuration for SemStreams E2E tests

Index

Constants

This section is empty.

Variables

View Source
var ComponentPaths = struct {
	Base   string
	Health string
	List   string
}{
	Base:   "/components",
	Health: "/components/health",
	List:   "/components/list",
}

ComponentPaths defines API paths for component endpoints

View Source
var DefaultEndpoints = struct {
	HTTP    string
	UDP     string
	NATS    string
	Metrics string
	PProf   string
}{
	HTTP:    "http://localhost:38080",
	UDP:     "localhost:34550",
	NATS:    "nats://localhost:34222",
	Metrics: "http://localhost:39090",
	PProf:   "http://localhost:36060",
}

DefaultEndpoints provides default SemStreams service endpoints Ports use 3xxxx range to avoid collisions with other local services

View Source
var DefaultTestConfig = struct {
	// Test execution
	Timeout         time.Duration
	RetryInterval   time.Duration
	MaxRetries      int
	ValidationDelay time.Duration

	// core data test config
	MessageCount    int
	MessageInterval time.Duration
	MinProcessed    int
}{

	Timeout:         10 * time.Second,
	RetryInterval:   1 * time.Second,
	MaxRetries:      30,
	ValidationDelay: 5 * time.Second,

	MessageCount:    10,
	MessageInterval: 100 * time.Millisecond,
	MinProcessed:    5,
}

DefaultTestConfig provides default test configuration values

View Source
var ServicePaths = struct {
	Health string
}{
	Health: "/health",
}

ServicePaths defines API paths for service endpoints

Functions

This section is empty.

Types

type ValidationConfig

type ValidationConfig struct {
	// MinStorageRate is the minimum acceptable ratio of stored to sent entities (default: 0.80)
	MinStorageRate float64

	// RequiredIndexes lists index buckets that must have entries after processing
	RequiredIndexes []string

	// RequiredMetrics lists Prometheus metrics that must be present after processing
	RequiredMetrics []string

	// ValidationTimeout is the maximum time to wait for processing before validation
	ValidationTimeout time.Duration
}

ValidationConfig holds configurable validation thresholds for E2E tests

func DefaultValidationConfig

func DefaultValidationConfig() *ValidationConfig

DefaultValidationConfig returns a ValidationConfig with sensible defaults

type ValidationResult

type ValidationResult struct {
	// EntitiesSent is the count of entities sent through the pipeline
	EntitiesSent int

	// EntitiesStored is the count of entities found in NATS KV
	EntitiesStored int

	// StorageRate is the ratio of stored to sent entities (0.0-1.0)
	StorageRate float64

	// IndexesChecked lists which indexes were validated
	IndexesChecked []string

	// IndexesPopulated is the count of indexes with at least one entry
	IndexesPopulated int

	// MetricsVerified lists Prometheus metrics found
	MetricsVerified []string

	// MetricsMissing lists expected metrics that were not found
	MetricsMissing []string
}

ValidationResult contains the outcomes of NATS KV validation

func NewValidationResult

func NewValidationResult(entitiesSent int) *ValidationResult

NewValidationResult creates a new ValidationResult with the given sent count

func (*ValidationResult) CalculateStorageRate

func (r *ValidationResult) CalculateStorageRate()

CalculateStorageRate computes the storage rate from sent and stored counts

func (*ValidationResult) MeetsThreshold

func (r *ValidationResult) MeetsThreshold(threshold float64) bool

MeetsThreshold returns true if the storage rate meets or exceeds the given threshold

Jump to

Keyboard shortcuts

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