MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / UpdateCacheMetrics

Function UpdateCacheMetrics

pkg/cache/cache.go:22–28  ·  view source on GitHub ↗

UpdateCacheMetrics is called directly by the prom handler

()

Source from the content-addressed store, hash-verified

20
21// UpdateCacheMetrics is called directly by the prom handler
22func UpdateCacheMetrics() {
23 metrics.CacheMetrics.Reset()
24
25 for i, name := range CacheNames {
26 metrics.CacheMetrics.With(prometheus.Labels{"name": name, "type": CacheConfig[i].Strategy}).Set(float64(Caches[i].Len(false)))
27 }
28}
29
30type CacheCfg struct {
31 Name string

Callers 1

computeDynamicMetricsFunction · 0.92

Calls 4

ResetMethod · 0.45
SetMethod · 0.45
WithMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…