MCPcopy Index your code
hub / github.com/coder/coder / cleanupDescCache

Method cleanupDescCache

coderd/prometheusmetrics/aggregator.go:524–531  ·  view source on GitHub ↗

Move to a function for testability

()

Source from the content-addressed store, hash-verified

522
523// Move to a function for testability
524func (ma *MetricsAggregator) cleanupDescCache() {
525 now := ma.clock.Now()
526 for key, entry := range ma.descCache {
527 if now.Sub(entry.lastUsed) > ma.metricsCleanupInterval {
528 delete(ma.descCache, key)
529 }
530 }
531}
532
533func asPrometheusValueType(metricType agentproto.Stats_Metric_Type) (prometheus.ValueType, error) {
534 switch metricType {

Callers 2

RunMethod · 0.95
TestDescCache_DescExpireFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestDescCache_DescExpireFunction · 0.76