stat

package
v0.0.0-...-229c351 Latest Latest
Warning

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

Go to latest
Published: May 15, 2015 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBMetrics

type DBMetrics struct {
	Tables    map[string]*TableMetrics
	SizeBytes *metrics.Gauge
}

DBMetrics - includes metrics for dbs and a mapping to tables in the db

type ModeMetrics

type ModeMetrics struct {
	Locks *metrics.Gauge
}

ModeMetrics - metrics on lock modes

type PostgresStat

type PostgresStat struct {
	Metrics *PostgresStatMetrics

	DBs   map[string]*DBMetrics
	Modes map[string]*ModeMetrics

	PGDATA string
	// contains filtered or unexported fields
}

PostgresStat stores info on the db

func New

func New(m *metrics.MetricContext, user, config string) (*PostgresStat, error)

Opens connection to postgres database and starts collector for metrics

func (*PostgresStat) CallByMethodName

func (s *PostgresStat) CallByMethodName(name string) error

CallByMethodName searches for a method implemented by s with name. Runs all methods that match names.

func (*PostgresStat) Close

func (s *PostgresStat) Close()

Closes database connection

func (*PostgresStat) Collect

func (s *PostgresStat) Collect()

runs metrics collections

type PostgresStatMetrics

type PostgresStatMetrics struct {
	Uptime               *metrics.Counter
	Version              *metrics.Gauge
	TPS                  *metrics.Counter
	BlockReadsDisk       *metrics.Counter
	BlockReadsCache      *metrics.Counter
	CacheHitPct          *metrics.Gauge
	CommitRatio          *metrics.Gauge
	WalKeepSegments      *metrics.Gauge
	SessionMax           *metrics.Gauge
	SessionCurrentTotal  *metrics.Gauge
	SessionBusyPct       *metrics.Gauge
	ConnMaxPct           *metrics.Gauge
	OldestTrxS           *metrics.Gauge
	OldestQueryS         *metrics.Gauge
	ActiveLongRunQueries *metrics.Gauge
	LockWaiters          *metrics.Gauge
	CpuPct               *metrics.Gauge
	MemPct               *metrics.Gauge
	VSZ                  *metrics.Gauge
	RSS                  *metrics.Gauge
	UnsecureUsers        *metrics.Gauge
	Writable             *metrics.Gauge //0 if not writable, 1 if writable
	BackupsRunning       *metrics.Gauge
	BinlogFiles          *metrics.Gauge
	DBSizeBinlogs        *metrics.Gauge
	SecondsBehindMaster  *metrics.Gauge
	SlavesConnectedToMe  *metrics.Gauge
	VacuumsAutoRunning   *metrics.Gauge
	VacuumsManualRunning *metrics.Gauge
	SlaveBytesBehindMe   *metrics.Gauge
}

PostgresStatMetrics

func PostgresStatMetricsNew

func PostgresStatMetricsNew(m *metrics.MetricContext) *PostgresStatMetrics

Initializes PostgresStatMetrics

type TableMetrics

type TableMetrics struct {
	SizeBytes *metrics.Gauge
}

TableMetrics - metrics for each table

Jump to

Keyboard shortcuts

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