Documentation ¶
Overview ¶
Package groupcache_exporter exports prometheus metrics for groupcache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter implements interface prometheus.Collector to extract metrics from groupcache.
func NewExporter ¶
func NewExporter(namespace string, labels map[string]string, groups ...GroupStatistics) *Exporter
NewExporter creates Exporter. namespace is usually the empty string.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect is called by the Prometheus registry when collecting metrics.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe sends metrics descriptors.
type GroupStatistics ¶
type GroupStatistics interface { // Name returns the group's name Name() string // Gets represents any Get request, including from peers Gets() int64 // CacheHits represents either cache was good CacheHits() int64 // GetFromPeersLatencyLower represents slowest duration to request value from peers GetFromPeersLatencyLower() int64 // PeerLoads represents either remote load or remote cache hit (not an error) PeerLoads() int64 // PeerErrors represents a count of errors from peers PeerErrors() int64 // Loads represents (gets - cacheHits) Loads() int64 // LoadsDeduped represents after singleflight LoadsDeduped() int64 // LocalLoads represents total good local loads LocalLoads() int64 // LocalLoadErrs represents total bad local loads LocalLoadErrs() int64 // ServerRequests represents gets that came over the network from peers ServerRequests() int64 MainCacheItems() int64 MainCacheBytes() int64 MainCacheGets() int64 MainCacheHits() int64 MainCacheEvictions() int64 HotCacheItems() int64 HotCacheBytes() int64 HotCacheGets() int64 HotCacheHits() int64 HotCacheEvictions() int64 }
GroupStatistics is a plugable interface to extract metrics from a groupcache implementation. GroupStatistics is used by Exporter to collect the group statistics. The user must provide a concrete implementation of this interface that knows how to extract group statistics from the actual groupcache implementation.
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
groupcache-exporter-google
Package main implements the example.
|
Package main implements the example. |
groupcache-exporter-mailgun
Package main implements the example.
|
Package main implements the example. |
groupcache-exporter-modernprogram
Package main implements the example.
|
Package main implements the example. |
groupcache
|
|
google
Package google implements an adapter to extract metrics from google groupcache.
|
Package google implements an adapter to extract metrics from google groupcache. |
mailgun
Package mailgun implements an adapter to extract metrics from mailgun groupcache.
|
Package mailgun implements an adapter to extract metrics from mailgun groupcache. |
modernprogram
Package modernprogram implements an adapter to extract metrics from modernprogram groupcache.
|
Package modernprogram implements an adapter to extract metrics from modernprogram groupcache. |