entities

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ClusterName is an identifier for the cluster
	ClusterName string
)
View Source
var DeploymentType string

DeploymentType is either sharded_cluster, replica_set, or standalone

Functions

func DetectDeploymentType

func DetectDeploymentType(session connection.Session) (string, error)

DetectDeploymentType tries to detect what type of mongo deployment is being monitored

func GetShards

func GetShards(session connection.Session, integration *integration.Integration) ([]string, error)

GetShards creates an array of ShardCollectors

Types

type Cmd added in v1.1.0

type Cmd map[string]interface{}

Cmd is an aliasi for map[string]interface{}

type Collector

type Collector interface {
	CollectMetrics()
	CollectInventory()
	GetName() string
	GetEntity() (*integration.Entity, error)
	GetIntegration() *integration.Integration
	GetSession() (connection.Session, error)
}

Collector is an interface which represents an entity. A Collector knows how to collect itself through the CollectMetrics and CollectInventory methods.

func GetClusters

func GetClusters(session connection.Session, integration *integration.Integration) ([]Collector, error)

GetClusters returns an array of MongosCollectors which will be collected

func GetCollections

func GetCollections(dbName string, session connection.Session, integration *integration.Integration, filter *filter.DatabaseFilter) ([]Collector, error)

GetCollections returns a list of CollectionCollectors which each collect a collection

func GetConfigServers

func GetConfigServers(session connection.Session, integration *integration.Integration) ([]Collector, error)

GetConfigServers returns a list of ConfigCollectors to collect

func GetDatabases

func GetDatabases(session connection.Session, integration *integration.Integration, filter *filter.DatabaseFilter) ([]Collector, error)

GetDatabases returns a list of DatabaseCollectors which each collect a specific database

func GetMongoses

func GetMongoses(session connection.Session, integration *integration.Integration) ([]Collector, error)

GetMongoses returns an array of MongosCollectors which will be collected

func GetReplSetMongods

func GetReplSetMongods(session connection.Session, integration *integration.Integration) ([]Collector, error)

GetReplSetMongods attempts to connect to a member of a rreplica set to eplica set to

func GetShardMongods

func GetShardMongods(session connection.Session, shardHostString string, integration *integration.Integration) ([]Collector, error)

GetShardMongods attempts to connect to a member of the shard to retrieve shard configuration information

func GetStandaloneMongod added in v1.1.0

func GetStandaloneMongod(session connection.Session, integration *integration.Integration) Collector

GetStandaloneMongod creates a mongod from a session

Jump to

Keyboard shortcuts

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