mongodb

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: BSD-3-Clause Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMongoDB

func NewMongoDB(conf plugin.InitConfig) plugin.Plugin

NewMongoDB XXX

Types

type DataLayer

type DataLayer interface {
	Run(cmd interface{}, result interface{}) error
}

DataLayer is an interface to access to the database struct.

type MongoDB

type MongoDB struct {
	Server            string
	Timeout           int64
	Tags              []string
	AdditionalMetrics []string `yaml:"additional_metrics"`
}

MongoDB XXX

func (*MongoDB) Check

func (m *MongoDB) Check(agg metric.Aggregator) error

Check XXX

type MongoSession

type MongoSession struct {
	*mgo.Session
}

MongoSession is currently a Mongo session.

func (MongoSession) DB

func (s MongoSession) DB(name string) DataLayer

DB shadows *mgo.DB to returns a DataLayer interface instead of *mgo.Database.

type ReplSetMember

type ReplSetMember struct {
	Name       string    `bson:"name"`
	Health     int64     `bson:"health"`
	State      int64     `bson:"state"`
	StateStr   string    `bson:"stateStr"`
	OptimeDate time.Time `bson:"optimeDate"`
	Self       bool      `bson:"self"`
}

ReplSetMember stores information related to a replica set member

type ReplSetStatus

type ReplSetStatus struct {
	Members []ReplSetMember `bson:"members"`
	MyState int64           `bson:"myState"`
}

ReplSetStatus stores information from replSetGetStatus

type Session

type Session interface {
	Run(cmd interface{}, result interface{}) error
	DB(name string) DataLayer
	DatabaseNames() (names []string, err error)
	Close()
}

Session is an interface to access to the Session struct.

type Top

type Top struct {
	Totals map[string]bson.M `bson:"totals"`
}

Top stores information from replSetGetStatus

Jump to

Keyboard shortcuts

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