postgresql

package
v0.0.0-...-be347a3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package postgresql is a Metricbeat module that contains MetricSets.

Package postgresql is Metricbeat module for PostgreSQL server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetPostgresql

func AssetPostgresql() string

AssetPostgresql returns asset data. This is the base64 encoded gzipped contents of ../metricbeat/module/postgresql.

func GetDSN

func GetDSN(host string) string

GetDSN returns the Data Source Name for a given host

func GetEnvPassword

func GetEnvPassword() string

GetEnvPassword returns the password

func GetEnvUsername

func GetEnvUsername() string

GetEnvUsername returns the username

func NewModule

func NewModule(base mb.BaseModule) (mb.Module, error)

NewModule returns a new instance of the module

func ParseURL

func ParseURL(mod mb.Module, rawURL string) (mb.HostData, error)

ParseURL is the postgres host parser

Types

type MetricSet

type MetricSet struct {
	mb.BaseMetricSet
	// contains filtered or unexported fields
}

func NewMetricSet

func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error)

NewMetricSet creates a PostgreSQL metricset with a pool of connections

func (*MetricSet) Close

func (ms *MetricSet) Close() error

Close closes the metricset and its connections

func (*MetricSet) DB

func (ms *MetricSet) DB(ctx context.Context) (*sql.Conn, error)

DB creates a database connection, it must be freed after use with `Close()`

func (*MetricSet) QueryStats

func (ms *MetricSet) QueryStats(ctx context.Context, query string) ([]map[string]interface{}, error)

QueryStats makes the database call for a given metric

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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