model

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceTypeSystem defines label string for system service.
	ServiceTypeSystem = "system"
	// ServiceTypePostgresql defines label string for Postgres services.
	ServiceTypePostgresql = "postgres"
	// ServiceTypePgbouncer defines label string for Pgbouncer services.
	ServiceTypePgbouncer = "pgbouncer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorSettings added in v0.4.23

type CollectorSettings struct {
	// Filters defines label-based filters applied to metrics.
	Filters filter.Filters `yaml:"filters"`
	// Subsystems defines subsystem with user-defined metrics.
	Subsystems Subsystems `yaml:"subsystems"`
}

CollectorSettings unions all settings related to a single collector.

type CollectorsSettings added in v0.4.23

type CollectorsSettings map[string]CollectorSettings

CollectorsSettings unions all collectors settings in one place.

type Metrics added in v0.4.23

type Metrics []UserMetric

Metrics unions all metrics in one place.

type MetricsSubsystem added in v0.4.23

type MetricsSubsystem struct {
	// Databases defines which databases should be visited for collecting metrics.
	Databases string `yaml:"databases"`
	// DatabasesRE defines regexp object based on Databases.
	DatabasesRE *regexp.Regexp
	// Query defines a SQL statement used for getting label/values for metrics.
	Query string `yaml:"query"`
	// Metrics defines a list of labels and metrics should be extracted from Query result.
	Metrics Metrics `yaml:"metrics"`
}

MetricsSubsystem describes a single subsystem.

type PGResult

type PGResult struct {
	Nrows    int
	Ncols    int
	Colnames []pgproto3.FieldDescription
	Rows     [][]sql.NullString
}

PGResult is the iterable store that contains query result (data and metadata) returned from Postgres

type Subsystems added in v0.4.23

type Subsystems map[string]MetricsSubsystem

Subsystems unions all subsystems in one place.

type UserMetric added in v0.4.23

type UserMetric struct {
	ShortName     string              `yaml:"name"`
	Usage         string              `yaml:"usage"`
	Labels        []string            `yaml:"labels,omitempty"`
	Value         string              `yaml:"value"`
	LabeledValues map[string][]string `yaml:"labeled_values,omitempty"`
	Description   string              `yaml:"description"`
}

UserMetric defines a single user-defined metric and its properties.

Jump to

Keyboard shortcuts

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