postgres

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

type Collector

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

func New

func New(dsn string, scrapeInterval, collectTimeout time.Duration, logger logger.Logger, emitter dbtracker.ChangeEmitter, targetAddr string, maxTablesPerDB int, trackSizes bool, excludeDatabases []string) (*Collector, error)

func (*Collector) Close

func (c *Collector) Close() error

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

type Connection

type Connection struct {
	DB            sql.NullString
	User          sql.NullString
	Query         sql.NullString
	State         sql.NullString
	QueryStart    sql.NullTime
	BackendType   sql.NullString
	WaitEventType sql.NullString
	BlockingPid   sql.NullInt32
}

func (Connection) IsClientBackend

func (c Connection) IsClientBackend() bool

func (Connection) QueryKey

func (c Connection) QueryKey() QueryKey

type ConnectionKey

type ConnectionKey struct {
	QueryKey
	State         string
	WaitEventType string
}

type LatencySummary

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

func NewLatencySummary

func NewLatencySummary() *LatencySummary

func (*LatencySummary) Add

func (s *LatencySummary) Add(totalTime float64, numberOfEvents uint64)

func (*LatencySummary) GetCalls

func (s *LatencySummary) GetCalls() float64

func (*LatencySummary) GetSummaries

func (s *LatencySummary) GetSummaries(percentiles ...float64) map[string]float64

func (*LatencySummary) GetTotalTime

func (s *LatencySummary) GetTotalTime() float64

type QueryKey

type QueryKey struct {
	Query string
	DB    string
	User  string
}

func (QueryKey) EqualByQueryPrefix

func (k QueryKey) EqualByQueryPrefix(other QueryKey) bool

type QuerySummary

type QuerySummary struct {
	Queries   float64
	TotalTime float64
	IOTime    float64
}

type Setting

type Setting struct {
	Name     string
	Unit     string
	Value    float64
	RawValue string
	Source   string // default, configuration file, command line, environment variable, global, override, session, client, etc.
	IsMetric bool   // true for integer, real, bool vartypes
}

Jump to

Keyboard shortcuts

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