test

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTest

func CreateTest(coordinator types.Coordinator, config *Config, variables types.Variables) (types.Test, error)

Types

type Config

type Config struct {
	Name         string                 `yaml:"name" json:"name"`
	Disable      bool                   `yaml:"disable" json:"disable"`
	Timeout      human.Duration         `yaml:"timeout" json:"timeout"`
	Config       map[string]interface{} `yaml:"config" json:"config"`
	ConfigVars   map[string]string      `yaml:"configVars" json:"configVars"`
	Tasks        []helper.RawMessage    `yaml:"tasks" json:"tasks"`
	CleanupTasks []helper.RawMessage    `yaml:"cleanupTasks" json:"cleanupTasks"`
}

type ExternalConfig

type ExternalConfig struct {
	File       string                 `yaml:"file" json:"file"`
	Name       string                 `yaml:"name" json:"name"`
	Timeout    *human.Duration        `yaml:"timeout" json:"timeout"`
	Config     map[string]interface{} `yaml:"config" json:"config"`
	ConfigVars map[string]string      `yaml:"configVars" json:"configVars"`
}

type Metrics

type Metrics struct {
	TaskInfo     *prometheus.GaugeVec
	TestDuration *prometheus.GaugeVec
	TestResult   *prometheus.GaugeVec

	CurrentTask  *prometheus.GaugeVec
	TotalTasks   *prometheus.GaugeVec
	TaskDuration *prometheus.GaugeVec
	TestInfo     *prometheus.GaugeVec
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(namespace, testName string) Metrics

NewMetrics returns a new Metrics instance.

func (*Metrics) Register

func (m *Metrics) Register()

func (*Metrics) SetTestDuration

func (m *Metrics) SetTestDuration(duration float64)

func (*Metrics) SetTestInfo

func (m *Metrics) SetTestInfo(description string)

func (*Metrics) SetTotalTasks

func (m *Metrics) SetTotalTasks(total float64)

type Test

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

func (*Test) GetTaskScheduler

func (t *Test) GetTaskScheduler() types.TaskScheduler

func (*Test) Logger

func (t *Test) Logger() logrus.FieldLogger

func (*Test) Name

func (t *Test) Name() string

func (*Test) Percent

func (t *Test) Percent() float64

func (*Test) Run

func (t *Test) Run(ctx context.Context) error

func (*Test) StartTime

func (t *Test) StartTime() time.Time

func (*Test) Status

func (t *Test) Status() types.TestStatus

func (*Test) StopTime

func (t *Test) StopTime() time.Time

func (*Test) Timeout

func (t *Test) Timeout() time.Duration

func (*Test) Validate

func (t *Test) Validate() error

Jump to

Keyboard shortcuts

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