pginfo

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PGInfo

type PGInfo struct {
	ClusterInfo        []*models.ClusterInfo
	ConnectedClients   []*models.ConnectedClients
	DatabaseWaitEvents []*models.DatabaseWaitEvents
	AllDatabases       []*models.Databases
	GlobalWaitEvents   []*models.GlobalWaitEvents
	PortAndDatadir     *models.PortAndDatadir
	SlaveHosts96       []*models.SlaveHosts96
	SlaveHosts10       []*models.SlaveHosts10
	Tablespaces        []*models.Tablespaces
	Settings           []*models.Setting
	Counters           map[models.Name][]*models.Counters    // Counters per database
	IndexCacheHitRatio map[string]*models.IndexCacheHitRatio // Indexes cache hit ratio per database
	TableCacheHitRatio map[string]*models.TableCacheHitRatio // Tables cache hit ratio per database
	TableAccess        map[string][]*models.TableAccess      // Table access per database
	ServerVersion      *version.Version
	Sleep              int
	Processes          []Process
	// contains filtered or unexported fields
}

PGInfo has exported fields containing the data collected. Fields are exported to be able to use them when printing the templates

func New

func New(db models.XODB, databases []string, sleep int) (*PGInfo, error)

New returns a new PGInfo instance with a local logger instance

func NewWithLogger

func NewWithLogger(db models.XODB, databases []string, sleep int, l *logrus.Logger) (*PGInfo, error)

NewWithLogger returns a new PGInfo instance with an external logger instance

func (*PGInfo) CollectGlobalInfo

func (i *PGInfo) CollectGlobalInfo(db models.XODB) []error

CollectGlobalInfo collects global information

func (*PGInfo) CollectPerDatabaseInfo

func (i *PGInfo) CollectPerDatabaseInfo(db models.XODB, dbName string) (err error)

CollectPerDatabaseInfo collects information for a specific database

func (*PGInfo) DatabaseNames

func (i *PGInfo) DatabaseNames() []string

DatabaseNames returns the list of the database names for which information will be collected

func (*PGInfo) SetLogLevel

func (i *PGInfo) SetLogLevel(level logrus.Level)

SetLogLevel changes the current log level

func (*PGInfo) SetLogger

func (i *PGInfo) SetLogger(l *logrus.Logger)

SetLogger sets an external logger instance

type Process

type Process struct {
	PID     int32
	CmdLine string
}

Process contains PostgreSQL process information

Jump to

Keyboard shortcuts

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