database

package
v2.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package database contains helper methods for retrieving data about each database in the target environment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabaseEntities

func CreateDatabaseEntities(i *integration.Integration, con *connection.SQLConnection, instanceName string) ([]*integration.Entity, error)

CreateDatabaseEntities instantiates an entity for each database we're collecting

Types

type DBMetricSetLookup

type DBMetricSetLookup map[string]*metric.Set

DBMetricSetLookup represents a cache of Database entitiy names to their corresponding metric set

func CreateDBEntitySetLookup

func CreateDBEntitySetLookup(dbEntities []*integration.Entity, instanceName, hostname string) DBMetricSetLookup

CreateDBEntitySetLookup creates a look up of Database entity name to a metric.Set

func (DBMetricSetLookup) GetDBNames

func (l DBMetricSetLookup) GetDBNames() []string

GetDBNames retrieves all names of databases in lookup

func (DBMetricSetLookup) MetricSetFromModel

func (l DBMetricSetLookup) MetricSetFromModel(model interface{}) (set *metric.Set, ok bool)

MetricSetFromModel given a data model that implements DatabaseDataModeler retrieve the metric set associated with the database.

ok will be false in tow cases, either model does not implement DatabaseDataModeler or a metric set does not exist for the database.

type DataModel

type DataModel struct {
	DBName string `db:"db_name"`
}

DataModel implements DatabaseDataModeler interface

func (DataModel) GetDBName

func (dm DataModel) GetDBName() string

GetDBName retrieves the DBName field

type DataModeler

type DataModeler interface {
	GetDBName() string
}

DataModeler represents a data model for a database query

type NameRow

type NameRow struct {
	DBName string `db:"db_name"`
}

NameRow is a row result in the databaseNameQuery

Jump to

Keyboard shortcuts

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