internal

package
v0.0.0-...-eb3b98a Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(settings *Settings) (err error)

Types

type DBSettings

type DBSettings struct {
	Driver string `yaml:"driver"`
	DSN    string `yaml:"dsn"`
}

type Labels

type Labels prometheus.Labels

func (Labels) String

func (l Labels) String() string

type Metric

type Metric struct {
	Name   string     `yaml:"name"`
	Query  string     `yaml:"query"`
	Type   MetricType `yaml:"type"`
	Values []string   `yaml:"values"`
	Labels []string   `yaml:"labels"`
}

type MetricExecutor

type MetricExecutor interface {
	Run() error
}

type MetricType

type MetricType = string
const (
	MetricTypeGauge     MetricType = "gauge"
	MetricTypeHistogram MetricType = "histogram"
	MetricTypeSummary   MetricType = "summary"
)

type MetricsJob

type MetricsJob struct {
	DB      DBSettings    `yaml:"db"`
	Period  time.Duration `yaml:"period"`
	Metrics []Metric      `yaml:"metrics"`
}

type Settings

type Settings struct {
	Host string       `yaml:"host"`
	Path string       `yaml:"path"`
	Jobs []MetricsJob `yaml:"jobs"`
}

Jump to

Keyboard shortcuts

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