Move to a function for testability
()
| 522 | |
| 523 | // Move to a function for testability |
| 524 | func (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 | |
| 533 | func asPrometheusValueType(metricType agentproto.Stats_Metric_Type) (prometheus.ValueType, error) { |
| 534 | switch metricType { |
no outgoing calls