validation

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNumChecks                    = 1000
	DefaultRequiredPriceLivenessPercent = 99.0
	DefaultValidationPeriod             = 10 * time.Minute
	DefaultBurnInPeriod                 = 60 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BurnInPeriod is the amount of time to let the sidecar run before checking validation.
	// This ensures that any markets or prices that take a few iterations to land will be populated,
	// eliminating false positives.
	BurnInPeriod time.Duration
	// ValidationPeriod is the amount of time the validation service will check that prices are landing correctly.
	ValidationPeriod time.Duration
	// NumChecks is the number of times the validation service will check validity over the ValidationPeriod.
	NumChecks int
	// RequiredPriceLivenessPercent is the percentage of liveness each price must demonstrate to be considered "valid".
	RequiredPriceLivenessPercent float64
}

Config includes information for configuring a validation service instance.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a default validation config.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks the validity of fields in the Config.

type LivenessResults

type LivenessResults map[string]float64

type Validator

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

func NewDefaultValidator

func NewDefaultValidator(logger *zap.Logger, metrics oraclemetrics.Metrics) Validator

NewDefaultValidator returns a new validator service with the default configuration.

func NewValidator

func NewValidator(logger *zap.Logger, metrics oraclemetrics.Metrics, cfg Config) Validator

NewValidator returns a new validator service with given configuration.

func (*Validator) Run

Run runs the validation service, checking for missing prices and accumulating liveness data.

Jump to

Keyboard shortcuts

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