Documentation ¶
Overview ¶
Package mongometrics contains MongodB-related Prometheus metric collectors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialCollector ¶
type DialCollector struct {
// contains filtered or unexported fields
}
DalCollector is a prometheus.Collector that collects MongoDB connection dialing metrics from Juju code.
func NewDialCollector ¶
func NewDialCollector() *DialCollector
NewDialCollector returns a new DialCollector.
func (*DialCollector) Collect ¶
func (c *DialCollector) Collect(ch chan<- prometheus.Metric)
Collect is part of the prometheus.Collector interface.
func (*DialCollector) Describe ¶
func (c *DialCollector) Describe(ch chan<- *prometheus.Desc)
Describe is part of the prometheus.Collector interface.
func (*DialCollector) PostDialServer ¶
func (c *DialCollector) PostDialServer(server string, duration time.Duration, dialErr error)
PostDialServer is a function that may be used in mongo.DialOpts.PostDialServer, to update metrics.
type MgoStatsCollector ¶
type MgoStatsCollector struct {
// contains filtered or unexported fields
}
MgoStatsCollector is a prometheus.Collector that collects metrics based on mgo stats.
func NewMgoStatsCollector ¶
func NewMgoStatsCollector(getCurrentStats func() mgo.Stats) *MgoStatsCollector
NewMgoStatsCollector returns a new MgoStatsCollector.
func (*MgoStatsCollector) Collect ¶
func (c *MgoStatsCollector) Collect(ch chan<- prometheus.Metric)
Collect is part of the prometheus.Collector interface.
func (*MgoStatsCollector) Describe ¶
func (c *MgoStatsCollector) Describe(ch chan<- *prometheus.Desc)
Describe is part of the prometheus.Collector interface.
type TxnCollector ¶
type TxnCollector struct {
// contains filtered or unexported fields
}
TxnCollector is a prometheus.Collector that collects metrics about mgo/txn operations.
func NewTxnCollector ¶
func NewTxnCollector() *TxnCollector
NewTxnCollector returns a new TxnCollector.
func (*TxnCollector) AfterRunTransaction ¶
func (c *TxnCollector) AfterRunTransaction(dbName, modelUUID string, attempt int, duration time.Duration, ops []txn.Op, err error)
AfterRunTransaction is called when a mgo/txn transaction has run.
func (*TxnCollector) Collect ¶
func (c *TxnCollector) Collect(ch chan<- prometheus.Metric)
Collect is part of the prometheus.Collector interface.
func (*TxnCollector) Describe ¶
func (c *TxnCollector) Describe(ch chan<- *prometheus.Desc)
Describe is part of the prometheus.Collector interface.