Cache metrics server (#1746)
* plugin/cache: per server metrics Use per server metrics in the cache plugin as well. This required some plumbing changes. Also use request.Request more. * fix cherry-pick
This commit is contained in:
parent
85f549b529
commit
bfc647d4ed
5 changed files with 44 additions and 59 deletions
11
plugin/cache/setup.go
vendored
11
plugin/cache/setup.go
vendored
|
@ -36,21 +36,12 @@ func setup(c *caddy.Controller) error {
|
|||
c.OnStartup(func() error {
|
||||
once.Do(func() {
|
||||
metrics.MustRegister(c,
|
||||
cacheSize, cacheCapacity,
|
||||
cacheHits, cacheMisses,
|
||||
cacheSize, cacheHits, cacheMisses,
|
||||
cachePrefetches, cacheDrops)
|
||||
})
|
||||
return nil
|
||||
})
|
||||
|
||||
// Initialize all counters and gauges.
|
||||
cacheSize.WithLabelValues(Success)
|
||||
cacheSize.WithLabelValues(Denial)
|
||||
cacheCapacity.WithLabelValues(Success).Set(float64(ca.pcap))
|
||||
cacheCapacity.WithLabelValues(Denial).Set(float64(ca.ncap))
|
||||
cacheHits.WithLabelValues(Success)
|
||||
cacheHits.WithLabelValues(Denial)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue