config

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDataDir = "/data/exporter_dsc"
View Source
const DefaultInterval = 5 * time.Second
View Source
const DefaultLogLevel = slog.LevelInfo
View Source
const DefaultPrometheusPort = 2112
View Source
const DefaultRemoveReadFiles = false
View Source
const DefaultTimestamps = true
View Source
const DefaultWindowSize = 5

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func GetLastFullMin

func GetLastFullMin() time.Time

func GetLogLevel

func GetLogLevel(logLevelString string) slog.Level

Types

type Aggregation

type Aggregation struct {
	Type   string                 `yaml:"type"`
	Params map[string]interface{} `yaml:"params"`
}

type BucketParams

type BucketParams struct {
	Start int
	Width int
	Count int
}

func (*BucketParams) Buckets

func (b *BucketParams) Buckets() []float64

type Config

type Config struct {
	RemoveReadFiles bool             `yaml:"remove"`
	DataDir         string           `yaml:"data"`
	Interval        time.Duration    `yaml:"interval"`
	Prometheus      PrometheusConfig `yaml:"prometheus"`
	LogLevel        slog.Level       `yaml:"loglevel"`
}

func ParseConfig

func ParseConfig(path string) Config

func ParseConfigText

func ParseConfigText(content []byte) Config

type MaxCellsParams

type MaxCellsParams struct {
	X int
}

type MetricConfig

type MetricConfig struct {
	Aggregations map[string]Aggregation `yaml:"aggregations"`
}

func (*MetricConfig) IsBucket

func (mC *MetricConfig) IsBucket(label string) (bool, BucketParams)

func (*MetricConfig) IsEliminateDimension

func (mC *MetricConfig) IsEliminateDimension(label string) bool

func (*MetricConfig) IsFilter

func (mC *MetricConfig) IsFilter(label string) (bool, []string)

func (*MetricConfig) IsMaxCells

func (mC *MetricConfig) IsMaxCells(label string) (bool, MaxCellsParams)

type PrometheusConfig

type PrometheusConfig struct {
	Metrics    map[string]MetricConfig `yaml:"metrics"`
	Port       int                     `yaml:"port"`
	Timestamps bool                    `yaml:"timestamps"`
	WindowSize int                     `yaml:"windowsize"`
}

func (*PrometheusConfig) IsInTimeWindow

func (p *PrometheusConfig) IsInTimeWindow(timestamp time.Time) bool

Jump to

Keyboard shortcuts

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