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 CacheDelta ¶ added in v1.3.2
type CacheDelta struct {
Gets int64
Hits int64
PeerLoads int64
PeerErrors int64
Loads int64
LoadsDeduped int64
LocalLoads int64
LocalLoadsErrs int64
ServerRequests int64
CrosstalkRefusals int64
}
CacheDelta represents deltas for cache stats.
func GetCacheDelta ¶ added in v1.3.2
func GetCacheDelta(prev, curr GroupStats) CacheDelta
GetCacheDelta calculates deltas for cache stats.
type CacheTypeDelta ¶ added in v1.3.2
CacheTypeDelta represents deltas for per-type cache stats.
func GetCacheTypeDelta ¶ added in v1.3.2
func GetCacheTypeDelta(prev, curr CacheTypeStats) CacheTypeDelta
GetCacheTypeDelta calculates deltas for per-type cache stats.
type CacheTypeStats ¶ added in v1.1.0
type CacheTypeStats struct {
// GaugeCacheItems represents number of items in the main/hot cache
GaugeCacheItems int64
// GaugeCacheBytes represents number of bytes in the main/hot cache
GaugeCacheBytes int64
// CounterCacheGets represents number of get requests in the main/hot cache
CounterCacheGets int64
// CounterCacheHits represents number of hit in the main/hot cache
CounterCacheHits int64
// CounterCacheEvictions represents number of evictions in the main/hot cache
CounterCacheEvictions int64
// CounterCacheEvictionsNonExpired represents number of evictions for non-expired keys in the main/hot cache
CounterCacheEvictionsNonExpired int64
}
CacheTypeStats holds stats for the main cache or the hot cache.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter implements interface prometheus.Collector to extract metrics from groupcache.
func NewExporter ¶
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 {
// Collect requests metrics collection from implementation
Collect() Stats
// Name returns the group's name
Name() string
}
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.
type GroupStats ¶ added in v1.1.0
type GroupStats struct {
// CounterGets represents any Get request, including from peers
CounterGets int64
// CounterHits represents either cache was good
CounterHits int64
// GaugeGetFromPeersLatencyLower represents slowest duration to request value from peers
GaugeGetFromPeersLatencyLower float64
// CounterPeerLoads represents either remote load or remote cache hit (not an error)
CounterPeerLoads int64
// CounterPeerErrors represents a count of errors from peers
CounterPeerErrors int64
// CounterLoads represents (gets - cacheHits)
CounterLoads int64
// CounterLoadsDeduped represents after singleflight
CounterLoadsDeduped int64
// CounterLocalLoads represents total good local loads
CounterLocalLoads int64
// CounterLocalLoadsErrs represents total bad local loads
CounterLocalLoadsErrs int64
// CounterServerRequests represents gets that came over the network from peers
CounterServerRequests int64
// CounterCrosstalkRefusals represents refusals for additional crosstalks
CounterCrosstalkRefusals int64
}
GroupStats holds general stats for the group.
type Options ¶ added in v1.2.0
type Options struct {
Namespace string
Labels map[string]string
Debug bool
ListGroups func() []GroupStatistics
}
Options define parameters for Exporter.
type Stats ¶ added in v1.1.0
type Stats struct {
// Group holds general stats for the group.
Group GroupStats
// Main holds stats for the group main cache.
Main CacheTypeStats
// Hot holds stats for the group hot cache.
Hot CacheTypeStats
}
Stats holds full stats for the group.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
groupcache-exporter-google
command
Package main implements the example.
|
Package main implements the example. |
|
groupcache-exporter-mailgun
command
Package main implements the example.
|
Package main implements the example. |
|
groupcache-exporter-modernprogram
command
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. |