collector

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(o CollectConfig, dbnames []string) *pgmetrics.Model

Collect actually performs the metrics collection, based on the given options. If database names are specified, it connects to each in turn and accumulates results. If none are specified, the connection is attempted without a 'dbname' keyword (usually tries to connect to a database with same name as the user).

Ideally, this should return (*pgmetrics.Model, error). But for now, it does a log.Fatal(). This will be rectified in the future, and backwards-compatibility will be broken when that happens. You've been warned.

Types

type CollectConfig

type CollectConfig struct {
	// general
	TimeoutSec uint
	NoSizes    bool

	// collection
	Schema     string
	ExclSchema string
	Table      string
	ExclTable  string
	SQLLength  uint
	StmtsLimit uint
	Omit       []string

	// connection
	Host     string
	Port     uint16
	User     string
	Password string
}

CollectConfig is a bunch of options passed to the Collect() function to specify which metrics to collect and how.

func DefaultCollectConfig

func DefaultCollectConfig() CollectConfig

DefaultCollectConfig returns a CollectConfig initialized with default values. Some environment variables are consulted.

Jump to

Keyboard shortcuts

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