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 LockTimeoutMillisec uint NoSizes bool // collection Schema string ExclSchema string Table string ExclTable string SQLLength uint StmtsLimit uint Omit []string OnlyListedDBs bool LogFile string LogDir string LogSpan uint RDSDBIdentifier string AllDBs bool AzureResourceID string Pgpool bool // collect only pgpool information // connection Host string Port uint16 User string Password string Role 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.