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 ¶
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
type DataModeler ¶
type DataModeler interface {
GetDBName() string
}
DataModeler represents a data model for a database query