replstatus

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(base mb.BaseMetricSet) (mb.MetricSet, error)

New creates a new instance of the MetricSet Part of new is also setting up the configuration by processing additional configuration entries if needed.

Types

type CollSize

type CollSize struct {
	MaxSize int64   `bson:"maxSize"` // Shows the maximum size of the collection.
	Size    float64 `bson:"size"`    // The total size in memory of all records in a collection.
}

CollSize contains data about collection size

type Member

type Member struct {
	Health        bool      `bson:"health"`
	Name          string    `bson:"name"`
	State         int       `bson:"state"`
	StateStr      string    `bson:"stateStr"`
	Uptime        int       `bson:"uptime"`
	OpTime        OpTime    `bson:"optime"`
	OpTimeDate    time.Time `bson:"optimeDate"`
	ElectionTime  int64     `bson:"electionTime"`
	ElectionDate  time.Time `bson:"electaionDate"`
	ConfigVersion int       `bson:"configVersion"`
	Self          bool      `bson:"self"`
}

Member provides information about a member in the replica set.

type MemberState

type MemberState int

MemberState shows the state of a member in the replica set

const (
	// STARTUP state
	STARTUP MemberState = 0
	// PRIMARY state
	PRIMARY MemberState = 1
	// SECONDARY state
	SECONDARY MemberState = 2
	// RECOVERING state
	RECOVERING MemberState = 3
	// STARTUP2 state
	STARTUP2 MemberState = 5
	// UNKNOWN state
	UNKNOWN MemberState = 6
	// ARBITER state
	ARBITER MemberState = 7
	// DOWN state
	DOWN MemberState = 8
	// ROLLBACK state
	ROLLBACK MemberState = 9
	// REMOVED state
	REMOVED MemberState = 10
)

type MetricSet

type MetricSet struct {
	*mongodb.MetricSet
}

MetricSet type defines all fields of the MetricSet As a minimum it must inherit the mb.BaseMetricSet fields, but can be extended with additional entries. These variables can be used to persist data or configuration between multiple fetch calls.

func (*MetricSet) Fetch

func (m *MetricSet) Fetch(reporter mb.ReporterV2) error

Fetch methods implements the data gathering and data conversion to the right format. It publishes the event which is then forwarded to the output. In case of an error set the Error field of mb.Event or simply call report.Error().

type MongoReplStatus

type MongoReplStatus struct {
	Ok                      bool      `bson:"ok"`
	Set                     string    `bson:"set"`
	Date                    time.Time `bson:"date"`
	Members                 []Member  `bson:"members"`
	MyState                 int       `bson:"myState"`
	Term                    int       `bson:"term"`
	HeartbeatIntervalMillis int       `bson:"heartbeatIntervalMillis"`
	OpTimes                 struct {
		LastCommitted OpTime `bson:"lastCommittedOpTime"`
		Applied       OpTime `bson:"appliedOpTime"`
		Durable       OpTime `bson:"durableOpTime"`
	} `bson:"optimes"`
}

MongoReplStatus cointains the status of the replica set from the point of view of the server that processed the command.

type OpTime

type OpTime struct {
	Ts int64 `bson:"ts"` // The timestamp of the last operation applied to this member of the replica set
	T  int   `bson:"t"`  // The term in which the last applied operation was originally generated on the primary.
}

OpTime holds information regarding the operation from the operation log

Jump to

Keyboard shortcuts

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