config

package
v3.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExporterConfig

type ExporterConfig struct {
	// LogLevel is the log level.
	LogLevel string `yaml:"log_level"`

	// HTTPServerConfig is the configuration for the HTTP server.
	HTTPServerConfig struct {
		ListenAddress string `yaml:"listen_address"`
		MetricsPath   string `yaml:"metrics_path"`
	} `yaml:"http_server"`

	// SamplesPath is the path to the samples.
	SamplesPath string `yaml:"samples_path"`

	// SchedulerConfig is the configuration for the scheduler.
	SchedulerConfig struct {
		// RefreshSamplesInterval is the interval to refresh the samples.
		RefreshSamplesInterval time.Duration `yaml:"refresh_samples_interval"`
		// EnqueueSamplesInterval is the interval to enqueue the samples.
		EnqueueSamplesInterval time.Duration `yaml:"enqueue_samples_interval"`
	} `yaml:"scheduler"`

	WorkerConfig struct {
		// ParallelJobs is the size of the channel.
		ParallelJobs int `yaml:"parallel_jobs"`
		// MaxQueueSize is the max size of the queue.
		MaxQueueSize int `yaml:"max_queue_size"`
		// SleepBetweenJobs is the sleep between jobs.
		SleepBetweenJobs time.Duration `yaml:"sleep_between_jobs"`
	} `yaml:"worker"`

	// ScreenshotsConfig is the configuration for the screenshots.
	ScreenshotsConfig struct {
		// Timeout is the timeout for the screenshots.
		Timeout time.Duration `yaml:"timeout"`
		// Enable is the flag to enable screenshots.
		Enabled bool `yaml:"enabled"`
	} `yaml:"screenshots"`
}

ExporterConfig is the configuration for the exporter.

func LoadExporterConfig

func LoadExporterConfig(data []byte) (*ExporterConfig, error)

LoadExporterConfig loads from byte array.

func LoadExporterConfigFromFile

func LoadExporterConfigFromFile(path string) (*ExporterConfig, error)

LoadExporterConfigFromFile loads from file.

type SampleConfig

type SampleConfig struct {
	// Name is the sample name.
	Name string `yaml:"name"`

	// Description is the description of the sample.
	Description string `yaml:"description"`

	// Tags is the tags of the sample.
	Tags map[string]string `yaml:"tags"`

	// ScrapeInterval is the interval to scrape the sample.
	Interval time.Duration `yaml:"interval"`

	// Timeout is the timeout to scrape the sample.
	Timeout time.Duration `yaml:"timeout"`

	// Steps is the steps to scrape the sample.
	Steps []StepConfig `yaml:"steps"`
}

SampleConfig is the sample configuration.

func LoadSampleConfig

func LoadSampleConfig(data []byte) (*SampleConfig, error)

LoadSampleConfig loads from byte array.

func LoadSampleConfigFromFile

func LoadSampleConfigFromFile(path string) (*SampleConfig, error)

LoadSampleConfigFromFile loads from file.

type StepConfig

type StepConfig struct {
	// Plugin is the plugin to scrape the sample. If not value given, the latest used plugin will be used.
	Plugin string `yaml:"plugin"`
	// Action is the action to scrape the sample
	Action string `yaml:"action"`
	// Parameters is the parameters to scrape the sample
	Parameters map[string]string `yaml:"parameters"`
}

StepConfig is the step configuration.

Jump to

Keyboard shortcuts

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