exporter

package
v0.0.0-...-f8e6a58 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const VERSION string = "0.2"

Version

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func NewCollector

func NewCollector(db *sql.DB, config *Config) *Collector

func (*Collector) Collect

func (c *Collector) Collect() ([]*exportertools.Metric, error)

Collecting metrics

type Config

type Config struct {
	DSN             string
	Labels          map[string]string
	ExporterOptions map[string]string
	CacheTTL        int
	PgMetrics       []*PgMetric
}

type DatabaseStat

type DatabaseStat struct {
	Name                                          string
	Commit, Rollback                              int64
	Read, Hit                                     int64
	Returned, Fetched, Inserted, Updated, Deleted int64
	Conflicts, TempFiles, TempBytes, Deadlocks    int64
	ReadTime, WriteTime                           float64
}

statistics for database name provided

type PgMetric

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

func AddFromFile

func AddFromFile(queriesPath string) (metrics []*PgMetric)

AddFromFile reads yaml with metric parameter and serialize it

type PgMetricSpecs

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

type PostgresExporter

type PostgresExporter struct {
	*exportertools.BaseExporter
	Config *Config
	// contains filtered or unexported fields
}

Exporter collects Postgres metrics. It implements prometheus.Collector.

func CreateAndRegister

func CreateAndRegister(config *Config) (*PostgresExporter, error)

NewExporter returns a new PostgreSQL exporter for the provided DSN.

func (*PostgresExporter) Close

func (e *PostgresExporter) Close() (err error)

func (*PostgresExporter) Setup

func (e *PostgresExporter) Setup() error

Jump to

Keyboard shortcuts

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