model

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package model is a pgSCV model

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"
	// ServiceTypePatroni defines label string for Patroni services.
	ServiceTypePatroni = "patroni"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectorSettings

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

type CollectorsSettings map[string]CollectorSettings

CollectorsSettings unions all collectors settings in one place.

type Metrics

type Metrics []UserMetric

Metrics unions all metrics in one place.

type MetricsSubsystem

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 []pgconn.FieldDescription
	Rows     [][]sql.NullString
}

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

type Subsystems

type Subsystems map[string]MetricsSubsystem

Subsystems unions all subsystems in one place.

type UserMetric

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