postgres

package
v0.0.0-...-4e4e906 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveLock

type ActiveLock struct {
	RelationName       string `db:"relname" table:"Relation Name"`
	LockType           string `db:"locktype" table:"Lock Type"`
	Page               string `db:"page"`
	VirtualTransaction string `db:"virtualtransaction" table:"Virtual Transaction"`
	PID                string `db:"pid"`
	Mode               string `db:"mode"`
	Granted            string `db:"granted"`
}

type Activity

type Activity struct {
	ProcessID  string `db:"pid" table:"Process ID"`
	QueryStart string `db:"query_start" table:"Query Start"`
	State      string `db:"state"`
	Query      string `db:"query"`
}

type Bloat

type Bloat struct {
	Type       string `db:"type"`
	SchemaName string `db:"schemaname" table:"Schema Name"`
	ObjectName string `db:"object_name" table:"Object Name"`
	Bloat      string `db:"bloat"`
	Waste      string `db:"waste"`
}

type DBConnection

type DBConnection struct {
	// contains filtered or unexported fields
}

func NewDBConnection

func NewDBConnection(dbName DatabaseName) (*DBConnection, error)

func (*DBConnection) Close

func (dbConnection *DBConnection) Close()

func (*DBConnection) GetActiveLocks

func (dbConnection *DBConnection) GetActiveLocks() (activeLocks []ActiveLock, err error)

func (*DBConnection) GetActivity

func (dbConnection *DBConnection) GetActivity() (activity []Activity, err error)

func (*DBConnection) GetMissingIndexes

func (dbConnection *DBConnection) GetMissingIndexes() (missingIndexes []MissingIndex, err error)

func (*DBConnection) GetTableCacheHitRatios

func (dbConnection *DBConnection) GetTableCacheHitRatios() (tableCacheHitRatios []TableCacheHitRatio, err error)

func (*DBConnection) GetTableSizes

func (dbConnection *DBConnection) GetTableSizes() (tableSizes []TableSize, err error)

func (*DBConnection) GetUselessIndexes

func (dbConnection *DBConnection) GetUselessIndexes() (uselessIndexes []UselessIndex, err error)

func (*DBConnection) GetVacuumStats

func (dbConnection *DBConnection) GetVacuumStats() (vacuumStats []VacuumStat, err error)

func (*DBConnection) ListBloat

func (dbConnection *DBConnection) ListBloat() (bloat []Bloat, err error)

type Database

type Database struct {
	Name           DatabaseName `db:"datname"`
	Size           int          `db:"size" table:"-"`
	FormattedSize  string       `db:"formatted_size" table:"Size"`
	CommitRatio    string       `db:"commit_ratio" table:"Commit Ratio"`
	CacheHitRation string       `db:"cache_hit_ratio" table:"Cache Hit Ratio"`
	BlocksRead     int          `db:"blks_read" table:"Blocks Read"`
}

type DatabaseName

type DatabaseName string

type MissingIndex

type MissingIndex struct {
	RelationName    string `db:"relname"`
	TooMuchSeq      int    `db:"too_much_seq" table:"Too Much Seq"`
	MissingIndex    string `db:"missing_index" table:"Missing Index?"`
	RelationSize    string `db:"rel_size" table:"Size"`
	SequentialScans int    `db:"seq_scan" table:"Sequential Scans"`
	IndexScans      int    `db:"idx_scan" table:"Index Scans"`
}

type PG

type PG struct {
	// contains filtered or unexported fields
}

func NewPG

func NewPG() (*PG, error)

func (*PG) Close

func (pg *PG) Close()

func (*PG) ListDatabases

func (pg *PG) ListDatabases() (databases []Database, err error)

type TableCacheHitRatio

type TableCacheHitRatio struct {
	Table            string `db:"table_name"`
	DiskHits         int    `db:"disk_hits" table:"Disk Hits"`
	PercentDiskHits  string `db:"percent_disk_hits" table:"% Disk Hits"`
	PercentCacheHits string `db:"percent_cache_hits" table:"% Cache Hits"`
	TotalHits        int    `db:"total_hits" table:"Total Hits"`
}

type TableSize

type TableSize struct {
	Schema      string `db:"table_schema"`
	TableName   string `db:"table_name" table:"Table Name"`
	RowEstimate string `db:"row_estimate" table:"Row Estimate"`
	Table       string `db:"table"`
	Index       string `db:"index"`
	TOAST       string `db:"toast"`
	Total       string `db:"total"`
}

type UselessIndex

type UselessIndex struct {
	Table      string `db:"table"`
	Index      string `db:"index"`
	IndexSize  string `db:"index_size" table:"Index Size"`
	IndexScans int    `db:"index_scans" table:"Index Scans"`
}

type VacuumStat

type VacuumStat struct {
	Table               string `db:"table"`
	LastVacuum          string `db:"last_vacuum" table:"Last Vacuum"`
	LastAutoVacuum      string `db:"last_autovacuum" table:"Last Auto-Vacuum"`
	RowCount            string `db:"rowcount" table:"Row Count"`
	DeadRowCount        string `db:"dead_rowcount" table:"Dead Row Count"`
	RowsPerPage         string `db:"rows_per_page" table:"Rows per Page"`
	AutoVacuumThreshold string `db:"autovacuum_threshold" table:"Auto-Vacuum Threshold"`
	WillVacuum          string `db:"will_vacuum" table:"Will Vacuum"`
}

Jump to

Keyboard shortcuts

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