Skip to content

Commit

Permalink
Simplify GetMetrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Dec 4, 2024
1 parent 72a8db8 commit 7efa988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 4 additions & 2 deletions groupcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,12 @@ func (g *Group) CacheStats(which CacheType) CacheStats {
}
}

// CacheStatsMetrics exposes CacheStats as Prometheus metrics.
func (g *Group) CacheStatsMetrics() []prometheus.Collector {
// GetMetrics returns Prometheus metrics.
func (g *Group) GetMetrics() []prometheus.Collector {
return []prometheus.Collector{
&CacheStatsCollector{group: g},
metricGetFromPeerLatency,
metricUpdatePeerLatency,
}
}

Expand Down
8 changes: 0 additions & 8 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,3 @@ var (
Objectives: SummaryObjectives,
}, []string{"group", "peer"})
)

// GetMetrics about Groupcache.
func GetMetrics() []prometheus.Collector {
return []prometheus.Collector{
metricGetFromPeerLatency,
metricUpdatePeerLatency,
}
}

0 comments on commit 7efa988

Please sign in to comment.